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

Retry RebalanceInProgressException in CommitRecovery.Default #1312

Merged

Conversation

aartigao
Copy link
Contributor

@aartigao aartigao commented Mar 20, 2024

Fixes #1213

After inspecting the internals of Kafka Client's KafkaConsumer, any time a RebalanceInProgressException is thrown, the message states it can be retried after a call to poll().

https://github.com/apache/kafka/blob/5e3c2b738d253ff51a7a61fe08713f564ab647fa/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java#L1347

https://github.com/apache/kafka/blob/5e3c2b738d253ff51a7a61fe08713f564ab647fa/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java#L1437

https://github.com/apache/kafka/blob/5e3c2b738d253ff51a7a61fe08713f564ab647fa/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java#L1457

https://github.com/apache/kafka/blob/5e3c2b738d253ff51a7a61fe08713f564ab647fa/clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java#L1470

Given that we handle those poll() calls internally at intervals, it makes sense to follow the recommendation and also retry the commit requests. Eventually the rebalance will finish and the offsets will be committed successfully (or fail if the partitions are not assigned anymore to the consumer).

@aartigao aartigao merged commit 4e47aaf into fd4s:series/3.x Apr 2, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Any reason RebalanceInProgressException isn't considered inCommitRecovery.Default?
1 participant