-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
consumer-group: do not cancel sessions context during rebalance #2193
Conversation
After moving from 1.30.0 to 1.32.0, we are encountering issues that rolling large Kafka clusters (in our case, it's over 100 brokers) can cause a lot of reconnections in quick successions on the producers. It can be witnessed with logs like:
I suspect it might be because of #2110. If rolling a kafka cluster with many brokers and producers are handling a lot of messages, it can results in many of those messages stuck waiting for the producer clients to be ready, which can end up using it all memory and crashing. |
@@ -869,7 +869,6 @@ func (s *consumerGroupSession) heartbeatLoop() { | |||
retries = s.parent.config.Metadata.Retry.Max | |||
case ErrRebalanceInProgress: | |||
retries = s.parent.config.Metadata.Retry.Max | |||
s.cancel() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I misread the PR, it's @pavius who authored the original PR
@pavius 👋 can you comment on this PR? |
@dnwe Unfortunately two years have passed since I made those changes and I don't remember the intricate details here - i.e. why I called cancel :( |
after re-reading this area of code, I think the change makes sense — lets merge and we can roll out main into some applications to test the functionality longer term |
#2110 was merged to avoid stopping heatbeats on rebalance.
However, the change is not as effective as it could be since session context is canceled on rebalance (which results in the recreation of the session in the end).
This patch allows session consumer to continue its life if heartbeat loop detected rebalance event.