GithubHelp home page GithubHelp logo

Comments (5)

wvanbergen avatar wvanbergen commented on August 31, 2024

Yes, that could be the case.

However, there is not really much we can do in that case, except retrying. The other option would be to shut down / crash the consumer, after which the Zookeeper connection will eventually time out and the partition will be released implicitly.

I'd welcome PRs to make this more resilient.

from kafka.

bhirbec avatar bhirbec commented on August 31, 2024

What about notifying the caller (the piece of code that calls JoinConsumerGroup) by sending an error into the errors channel? This gives the opportunity to the caller to close the group and call JoinConsumerGroup again.

Code would be something like this:

defer func() {
    err := cg.instance.ReleasePartition(topic, partition)
    if err != nil {
        cg.Logf("%s/%d :: FAILED to release partition: %s\n", topic, partition, err)
        cg.errors <- &sarama.ConsumerError{
            Topic:     topic,
            Partition: partition,
            Err:       err,
        }
    }
}()

Does it seem reasonable to you? If so, I'll be glad to send you a PR.

Please, let me know that you think.

from kafka.

wvanbergen avatar wvanbergen commented on August 31, 2024

👍

from kafka.

bhirbec avatar bhirbec commented on August 31, 2024

Thanks in advance for taking a look at this PR

from kafka.

wvanbergen avatar wvanbergen commented on August 31, 2024

Should be fixed now your PR is merged.

from kafka.

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.