lianetm commented on PR #16686: URL: https://github.com/apache/kafka/pull/16686#issuecomment-2445322201
Hey @kirktrue , sounds mostly fair to me, one question and one proposal to move on from here :) Question is why 8?: > 8: The application thread will not wait for confirmation that the consumer left the group, **even if there is remaining time** If there is time, the classic consumer does wait for the leave request response: https://github.com/apache/kafka/blob/571f50817c0c3e81a8f767396e485bc23a0731ba/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java#L1135-L1140 and we intentionally did the fix on the new consumer. We don't need to "break" the case where there is time in order to fix the case of low timeout/interrupt I would say. Other than that, I would say that all your points work like that at the moment except only for 4 and 7, where we need to change things to make them happen: > 4. The application thread will block during the duration of the ConsumerRebalanceListener execution, regardless of interrupt state or the timeout provided > 7. An attempt for the consumer to leave the group is performed regardless of expired timeouts or interrupted state So proposal: 4 and 7 do not work simply because we need thread hops to achieve them, and those hops can't happen on interrupt/low timeouts. So would it work if we just decouple the `UnsubscribeEvent` to avoid those hops in the close case? Meaning that on close, instead of blocking on an UnsubscribeEvent that will start by coming back to the app thread, instead we: 1. trigger callbacks directly in the app thread -> will make 4 happen regardless or timeout/interrupt 2. generate a kind of `LeaveGroup` event, blocking on it to allow for the case where there is time to shutdown cleanly, but swallowing interrupt/timeouts. This event would only send the request, no callbacks -> will make 7 happen regardless of timeouts/interrupt, best effort Would that work? not sure if I could be missing something, thoughts? -- 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