lianetm commented on code in PR #19980:
URL: https://github.com/apache/kafka/pull/19980#discussion_r2298653648


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractFetch.java:
##########
@@ -222,6 +222,10 @@ protected void handleFetchSuccess(final Node fetchTarget,
                 fetchBuffer.add(completedFetch);
             }
 
+            // "Wake" the fetch buffer on any response, even if it's empty, to 
allow the consumer to not block
+            // indefinitely waiting on the fetch buffer to get data.
+            fetchBuffer.wakeup();

Review Comment:
   Should we notify the buffer as soon as we add the first completed batch to 
it, instead of waiting for all completed batches to be added? 
   
   Seems that will be closer to what the `ClassicConsumer` does by polling 
while `!fetcher.hasAvailableFetches()` (given that hasAvailable fetches will be 
true as soon as there is a first CompletedBatch added)



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

Reply via email to