AndrewJSchofield commented on code in PR #16686:
URL: https://github.com/apache/kafka/pull/16686#discussion_r1700570874
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:
##########
@@ -1227,6 +1227,7 @@ public void close(Duration timeout) {
private void close(Duration timeout, boolean swallowException) {
log.trace("Closing the Kafka consumer");
+ boolean wasInterrupted = Thread.interrupted();
Review Comment:
I don't think this is correct. With this code, if the thread was interrupted
BEFORE the close method was called, `Thread.interrupted` will return true and
then we will take different action. I think what we need is that if we were
interrupted WHILE the close method was running, then we need to leave the group
politely and then throw the `InterruptException`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]