junrao commented on code in PR #18737:
URL: https://github.com/apache/kafka/pull/18737#discussion_r1955057433


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/ApplicationEventProcessor.java:
##########
@@ -206,8 +206,15 @@ public void process(ApplicationEvent event) {
     }
 
     private void process(final PollEvent event) {
+        // Trigger a reconciliation that can safely commit offsets if needed 
to revoke partitions,
+        // as we're processing before any new fetching starts in the app thread
+        
requestManagers.consumerMembershipManager.ifPresent(consumerMembershipManager ->
+            consumerMembershipManager.maybeReconcile(true));
+        // notify the app thread could start the next poll cycle since commit 
request on revoke has been generated
+        event.future().complete(null);

Review Comment:
   Completing here is too early for auto commit, right? 
`commitRequestManager.updateTimerAndMaybeCommit` is called later.



##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java:
##########
@@ -861,6 +876,7 @@ void maybeReconcile() {
 
         commitResult = signalReconciliationStarted();
 
+

Review Comment:
   extra new line



-- 
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-unsubscr...@kafka.apache.org

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

Reply via email to