philipnee commented on code in PR #16272:
URL: https://github.com/apache/kafka/pull/16272#discussion_r1639205859


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:
##########
@@ -1512,7 +1513,9 @@ public void unsubscribe() {
                 }
                 resetGroupMetadata();
             }
-            subscriptions.unsubscribe();
+        } catch (Exception e) {
+            log.error("Unsubscribe failed", e);
+            throw e;

Review Comment:
   I wonder if we should handle the `java.lang.InterruptException` here or in 
the `ConsumerUtils`.  Currently, `ConsumerUtils` wraps the exception with 
KafkaException and doesn't do more.  I think we need to unset the interrupt 
flag using Thread.Interrupted() to allow consumer to have a clean shutdown when 
user invokes `close()`. 
   Also InterruptedException can be thrown everywhere by java, i guess the 
reason we are seeing this during shutdown is for the obvious reason, the worker 
calls unsubscribe before shutting down.



-- 
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

Reply via email to