hachikuji commented on PR #16686: URL: https://github.com/apache/kafka/pull/16686#issuecomment-2427464089
Without blocking, it seems impossible to make any guarantee about sending `LeaveGroup`. I think it's good enough to implement the previous best-effort approach. If we have test cases which are quietly depending on `LeaveGroup` being sent, we should probably loosen them. A guarantee around execution of the callback in `ConsumerRebalanceListener` seems more reasonable. > If I recall correctly, @kirktrue raised a good question in KIP-1092 (https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=321719077) about the guarantee of sending LEAVE_GROUP. Maybe we could enhance the close option by adding a flag to ensure LEAVE_GROUP is sent, even if it means ignoring timeout and interruption? This feels like overkill to me. As long as the documentation is clear about the consequences, I would rather have the client respect timeouts/interrupts to the extent that is possible. Also being clear to the user that it is up to them to ensure that listener callbacks are interruptible. In regard to the interrupt flag. As a user, I would expect one of two things if the interrupt flag is set when `close()` is called. 1. `close()` returns immediately without blocking and preserves the interrupt flag. 2. `close()` raises `InterruptException` as soon as it attempts any operation which would block. -- 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