You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/11/04 06:06:59 UTC

[GitHub] [kafka] RivenSun2 commented on a change in pull request #11340: KAFKA-13310 : KafkaConsumer cannot jump out of the poll method, and the…

RivenSun2 commented on a change in pull request #11340:
URL: https://github.com/apache/kafka/pull/11340#discussion_r742559955



##########
File path: clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
##########
@@ -1073,6 +1086,33 @@ private void doAutoCommitOffsetsAsync() {
         });
     }
 
+    private boolean maybeAutoCommitOffsetsAsync() {
+        if (autoCommitEnabled) {
+            invokeCompletedOffsetCommitCallbacks();
+
+            if (onJoinPrepareAsyncCommitFuture == null)

Review comment:
       Because we use asynchronous commitOffsets, and at the same time, in order not to block the Consumer#poll method
   We cannot call ConsumerNetworkClient#poll(future)
   
   The onJoinPrepareAsyncCommitFuture variable is introduced to deal with the "onJoinPrepareAsyncCommitFuture.isDone() == false" situation.
   
   Maybe my consideration is complicated, this situation can be retryed by Consumer#poll next time.




-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org