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

Merged
merged 3 commits into from
Jun 27, 2024
Merged

fix/rebalancing #30

merged 3 commits into from
Jun 27, 2024

Conversation

prOOrc
Copy link
Contributor

@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
Contributor

@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
Contributor 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
Contributor 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.

@m110
Copy link
Member

m110 commented Jun 27, 2024

Thank you for the contribution 🙏

@m110 m110 merged commit 2664bae into ThreeDotsLabs:master Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants