brandboat opened a new pull request, #18089: URL: https://github.com/apache/kafka/pull/18089
related to https://issues.apache.org/jira/browse/KAFKA-18160 This pr fix two issues as described below: - ConsumerRebalanceListenerCallbackCompletedEvent is skipped `invokeRebalanceCallbacks`could throw WakeupException/InterruptException [0] and they are NOT handled. Hence, the event `ConsumerRebalanceListenerCallbackCompletedEvent` is NOT sent to background thread. Solution: We should use try-catch blocks to propagate both InterruptedException and WakeupException to the background thread. - Corrupted added partitions In the next iteration of invokeRebalanceCallbacks, non-fetchable assigned partitions are treated as owned partitions [1]. This results in "empty" partitions being passed to the listener, meaning that the listener never receives the correctly added partitions after the first execution fails. Consequently, this causes the test_pause_and_resume_sink ([KAFKA-17962](https://issues.apache.org/jira/browse/KAFKA-17962)) to become unstable when using AsyncConsumer. Solution: We should add only partitions where pendingOnAssignedCallback is false to the owned partitions. [0] https://github.com/apache/kafka/blob/2d39d5be64d4f5b6446f4b9ec3f32b039707d9d1/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java#L2046 [1] https://github.com/apache/kafka/blob/2d39d5be64d4f5b6446f4b9ec3f32b039707d9d1/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractMembershipManager.java#L828 ### Committer Checklist (excluded from commit message) - [ ] Verify design and implementation - [ ] Verify test coverage and CI build status - [ ] Verify documentation (including upgrade notes) -- 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