Skip to content

Commit 7311fe5

Browse files
KAFKA-19929: Fix polling delay for share consumer in record-limit mode (#21007)
In record-limit mode, the share consume request manager was varying the time to wait between polls depending on whether there might be more requests to send in the future. However, this was based on a mistaken understanding of how the polling logic works. Reviewers: Lianet Magrans <lmagrans@confluent.io>
1 parent af934aa commit 7311fe5

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -768,15 +768,6 @@ private boolean isLeaderKnownToHaveChanged(int nodeId, TopicIdPartition topicIdP
768768
return false;
769769
}
770770

771-
@Override
772-
public long maximumTimeToWait(long currentTimeMs) {
773-
// When fetching records and there is no chosen node for fetching, we do not want to wait for the next poll in record_limit mode.
774-
if (isShareAcquireModeRecordLimit() && fetchMoreRecords && subscriptions.numAssignedPartitions() > 0 && fetchRecordsNodeId.get() == -1) {
775-
return 0L;
776-
}
777-
return Long.MAX_VALUE;
778-
}
779-
780771
private void handleShareFetchSuccess(Node fetchTarget,
781772
ShareFetchRequestData requestData,
782773
ClientResponse resp) {

0 commit comments

Comments
 (0)