chia7712 commented on code in PR #16156:
URL: https://github.com/apache/kafka/pull/16156#discussion_r1624811587


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkThread.java:
##########
@@ -293,12 +293,10 @@ private void closeInternal(final Duration timeout) {
      * Check the unsent queue one last time and poll until all requests are 
sent or the timer runs out.
      */
     private void sendUnsentRequests(final Timer timer) {
-        if (networkClientDelegate.unsentRequests().isEmpty())
-            return;
-        do {
+        while (timer.notExpired() && 
networkClientDelegate.hasAnyPendingRequests()) {

Review Comment:
   @lianetm you are right. Maybe we can keep origin code but we replace all 
`networkClientDelegate.unsentRequests().isEmpty()` by 
`!networkClientDelegate.hasAnyPendingRequests()`?



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