kirktrue commented on PR #16686: URL: https://github.com/apache/kafka/pull/16686#issuecomment-2375564338
Hi @chia7712! > Apologies, but I have another question. If the interrupt is swallowed, how can users forcefully close the consumer? The wakeup method doesn't work during close, and the timeout is ignored. What should users do if they truly need to interrupt the close process? When KAFKA-16985 was originally filed, we'd convinced ourselves that it was **vital** that a `Consumer` leave its group cleanly _even if it was interrupted_ prior to—or during—`close()`. Fundamental in the design of the new `AsyncKafkaConsumer` is the use of the `CompletableApplicationEvent` mechanism in which the application thread creates a `Future` which is completed by the background thread when the process is complete. When the user interrupts the thread, any subsequent call by the application thread to get the result of the `Future` will immediately fail. Given the way the code is currently structured, I don't believe we'll be able to ensure that we leave the group cleanly in that case. Thanks! -- 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