Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/rebalancing #30

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

prOOrc
Copy link

@prOOrc prOOrc commented Oct 5, 2023

Checking that the session context has been canceled. If this is not done, after rebalancing consumer will continue to work, but offset will not be able to commit because of error:

kafka server: The provided member is not known in the current generation

@wolfapple
Copy link

@prOOrc I found the same problem and fixed it a little differently. After submitting the PR, I discovered that you had already posted it.

@toshim45
Copy link

we're facing the same issue, waiting this PR to be merged

@nachogiljaldo
Copy link

+1 here

Copy link

@nachogiljaldo nachogiljaldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it works for sessionless consumers.

@@ -578,6 +581,9 @@ ResendLoop:
case <-ctx.Done():
h.logger.Trace("Closing, ctx cancelled before sent to consumer", receivedMsgLogFields)
return nil
case <-sessionContext.Done():

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

won't this fail since sess is nil?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Session can't be nil. Saram won't start consuming in such case. By the way sarama does the same check before consuming starts, but if rebalancing started after, during processing messages, it hangs on trying commit offset with staled session.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I've overlooked it. Fixed this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants