lianetm commented on code in PR #16686: URL: https://github.com/apache/kafka/pull/16686#discussion_r1727477284
########## 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: With this PR we're addressing not only the interrupt, but also the close(0). If I get it right, this line is what makes that the close(0) will always send the leave request (even if there are callbacks), correct? Could we add then an IT to see how close(0) with callbacks makes that the consumer leaves the group? (I expect it should be very similar to the IT added for the interrupt case, but no interrupt + close(0) ) -- 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