chia7712 commented on PR #16686: URL: https://github.com/apache/kafka/pull/16686#issuecomment-2412844022
> I am pretty sure we never had logic to do even a best-effort LeaveGroup after an interrupt, so all of the trickery in this patch to try and handle interrupts makes me suspicious. I agree (see my previous comment #16686). It seems that all the complexity around handling interruptions is more about managing the consumer listener than sending the LeaveGroup request. > When calling close() with a timeout of 0, I think we did something like this: client.send(LeaveGroup) client.poll(0) client.close() Yes, and we need to ensure that `ConsumerRebalanceListener` is executed before `client.send(LeaveGroup)`. > I'd be interested to know how reliably the LeaveGroup actually got sent. Probably works in local testing, but how about for a remote hop? In my opinion, we don't need to go that far. Perhaps we can adjust this PR to focus on the core issues for AsyncKafkaConsumer: 1. `ConsumerRebalanceListener` should execute during closing, regardless of timeout or interruption. 2. `ConsumerRebalanceListener` should be interruptible. 3. The LeaveGroup request should be attempted on a best-effort basis, while respecting the timeout and interruption. These adjustments would align the behavior with the classic consumer. -- 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