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


##########
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:
   just for the record, my expectations here were not right because of another 
gap discovered. This `processBackgrounEvents` is not enough to ensure that 
close(0) sends the leave, and https://issues.apache.org/jira/browse/KAFKA-17518 
was created. 



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