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/10/13 09:40:42 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_r727884034



##########
File path: clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java
##########
@@ -994,11 +996,16 @@ public boolean commitOffsetsSync(Map<TopicPartition, OffsetAndMetadata> offsets,
         if (offsets.isEmpty())
             return true;
 
+        boolean shouldCleanUpConsumedOffsets = !checkConsumedOffsetsAreValid(offsets);

Review comment:
       1. When re-join group via `maybeAutoCommitOffsetsSync`, the default timer is `time.timer(rebalanceTimeoutMs)`.
    Because our consumers' consumption logic is sometimes heavier, we refer to the configuration of Kafka stream https://kafka.apache.org/documentation/#upgrade_10201_notable
   Set max.poll.interval.ms to Integer.MAX_VALUE
   Therefore, in the maybeAutoCommitOffsetsSync method, there will be an endless loop of retry submitting the offset within the Integer.MAX_VALUE time.
   The impacts are: (1)rebalance cannot be completed, group consumption progress is suspended; (2)offsets  commit with a high frequency, and CPU consumption on the broker side increases sharply
   
   2.this method `maybeAutoCommitOffsetsSync(Timer timer)` , customers will not use this method. There are only two places to call this method: (1) onJoinPrepare(...) in ConsumerCoordinator (2) close(final Timer timer) in ConsumerCoordinator
   




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