AndrewJSchofield commented on code in PR #23014:
URL: https://github.com/apache/kafka/pull/23014#discussion_r3757916390
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/FetchRequestManager.java:
##########
@@ -146,9 +146,12 @@ private PollResult pollInternal(FetchRequestPreparer
fetchRequestPreparer,
Map<Node, FetchSessionHandler.FetchRequestData> fetchRequests =
fetchRequestPreparer.prepare();
if (fetchRequests.isEmpty()) {
- // If there's nothing to fetch, wake up the FetchBuffer so it
doesn't needlessly wait for a wakeup
- // that won't come until the data in the fetch buffer is
consumed.
- fetchBuffer.wakeup();
+ if (emptyResultShouldWakeBuffer()) {
Review Comment:
I think the naming here is a bit strange. The contract is essentially that
if it was not necessary to build any fetch requests, we should wake the buffer
if there are no events outstanding which will wake it soon. Could it be
`canWakeBufferIfNoFetchRequestsToSend` or similar? Maybe the
`fetchRequestPreparer` should be able to return this information in some way
directly.
--
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]