kirktrue commented on code in PR #16686:
URL: https://github.com/apache/kafka/pull/16686#discussion_r1775795978


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:
##########
@@ -1291,6 +1294,10 @@ private void releaseAssignmentAndLeaveGroup(final Timer 
timer) {
             log.warn("Consumer triggered an unsubscribe event to leave the 
group but couldn't " +
                 "complete it within {} ms. It will proceed to close.", 
timer.timeoutMs());
         } finally {
+            // Regardless of success or failure of the unsubscribe process, 
it's important to process any background
+            // events in the hope that our 
ConsumerRebalanceListenerCallbackNeededEvent is present and can be executed.
+            processBackgroundEvents();

Review Comment:
   Among other things, the background thread uses background events to signal 
the application thread to execute the `ConsumerRebalanceListener` callbacks.
   
   It was my understanding from looking at the code for the existing 
`ClassicKafkaConsumer` and from previous discussions on this topic that we need 
to execute the `ConsumerRebalanceListener.onPartitionsRevoked()` method when 
unsubscribing/leaving a group.



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