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


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkThread.java:
##########
@@ -274,79 +269,18 @@ private void closeInternal(final Duration timeout) {
     }
 
     void cleanup() {
+        log.trace("Closing the consumer network thread");
+        Timer timer = time.timer(closeTimeout);
         try {
-            log.trace("Closing the consumer network thread");
-            Timer timer = time.timer(closeTimeout);
-            maybeAutocommitOnClose(timer);
             runAtClose(requestManagers.entries(), networkClientDelegate, 
timer);
-            maybeLeaveGroup(timer);
         } catch (Exception e) {
             log.error("Unexpected error during shutdown.  Proceed with 
closing.", e);
         } finally {
+            networkClientDelegate.awaitPendingRequests(timer);

Review Comment:
   I think we actually don't need this here because runAtClose is already 
closing after checking the code. if the timer runs out, then we don't need to 
poll again. if all request are completed before timer runs out, then we don't 
need to repoll again.



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