RivenSun2 commented on code in PR #12349:
URL: https://github.com/apache/kafka/pull/12349#discussion_r909123353
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java:
##########
@@ -745,6 +745,10 @@ protected boolean onJoinPrepare(int generation, String
memberId) {
boolean onJoinPrepareAsyncCommitCompleted = false;
// async commit offsets prior to rebalance if auto-commit enabled
RequestFuture<Void> future = maybeAutoCommitOffsetsAsync();
+ // wait for commit offset response if future exist
+ if (future != null) {
+ client.poll(future,
time.timer(rebalanceConfig.rebalanceTimeoutMs));
+ }
Review Comment:
1. It is not easy to find a suitable value for 'the max retry time'. The
most important point is that we should ensure that the `poll` method of
kafkaConsumer can always return within the `pollDuration` time.
2. I don't think it's too much of a problem to wait for the
`rebalanceAutoCommitFuture` to complete by calling the poll method multiple
times.
We can take advice from other experts.
Thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]