Giter Site home page Giter Site logo

Comments (5)

davidzeng avatar davidzeng commented on August 22, 2024

I did a little bit more digging and it seems like my workerManagers aren't closing due to the lock from start batch. My callback for WorkerFailedAttemptCallback and WorkerFailureCallback are both doNotCommitAndStop.

I only have the 10 default workers and 14 partitions running (14 worker managers). It seems like what's happening is that the worker stops, but some partitions are running startBatch, which waits on an available worker, but since my callback stops the worker, there are no workers and the call blocks indefinitely. I bumped up the number of workers to 30 in an attempt to free up more workers, but it seems like that's not enough. I'm not sure if adding more workers is the solution here. Why doesn't the Close() call send a kill signal to the workers?

from go_kafka_client.

davidzeng avatar davidzeng commented on August 22, 2024

Another alternative is to have startBatch only block for a certain amount of time and then quit. However, I can see how that wouldn't be the best solution.

from go_kafka_client.

baconalot avatar baconalot commented on August 22, 2024

I presume you want to close the consumer from the messagehandler. I also got these problems, and my fix was to make a wrapper around the library; put a message processed item in a channel from the messagehandler if you want to continue processing; and in new mainloop stop if no message processed have been recieved on that channel after x seconds.

Not really nice, but for the most part it got rid of the fatals for me.

I agree this should be handled more graceful.

from go_kafka_client.

davidzeng avatar davidzeng commented on August 22, 2024

I'm calling Close() from the consumer that comes out of kafka.NewConsumer(kafkaConfig). @baconalot What's the messagehanlder you're talking about?

from go_kafka_client.

teou avatar teou commented on August 22, 2024

it's a dead lock when startBatch and Close all try to hold the stopLock in worker manager
and at the same time Close's managerStop channel is waiting on startBatch to finish and select data from the managerStop channel.

I don't see why the wm.stopLock is necessary here.

from go_kafka_client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.