Skip to content

Commit c529951

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 9ced615 commit c529951

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
@@ -769,15 +769,6 @@ private boolean isLeaderKnownToHaveChanged(int nodeId, TopicIdPartition topicIdP
769769
return false;
770770
}
771771

772-
@Override
773-
public long maximumTimeToWait(long currentTimeMs) {
774-
// 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.
775-
if (isShareAcquireModeRecordLimit() && fetchMoreRecords && subscriptions.numAssignedPartitions() > 0 && fetchRecordsNodeId.get() == -1) {
776-
return 0L;
777-
}
778-
return Long.MAX_VALUE;
779-
}
780-
781772
private void handleShareFetchSuccess(Node fetchTarget,
782773
ShareFetchRequestData requestData,
783774
ClientResponse resp) {

0 commit comments

Comments
 (0)