lianetm commented on code in PR #16031:
URL: https://github.com/apache/kafka/pull/16031#discussion_r1624694081
##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/CommitRequestManagerTest.java:
##########
@@ -747,21 +748,19 @@ public void
testOffsetCommitSyncTimeoutNotReturnedOnPollAndFails() {
new TopicPartition("topic", 1),
new OffsetAndMetadata(0));
- // Send sync offset commit request that fails with retriable error.
- long expirationTimeMs = time.milliseconds() + retryBackoffMs * 2;
- CompletableFuture<Void> commitResult =
commitRequestManager.commitSync(offsets, expirationTimeMs);
- completeOffsetCommitRequestWithError(commitRequestManager,
Errors.REQUEST_TIMED_OUT);
+ // Send sync offset commit request.
+ long deadlineMs = time.milliseconds() + retryBackoffMs * 2;
+ CompletableFuture<Void> commitResult =
commitRequestManager.commitSync(offsets, deadlineMs);
- // Request retried after backoff, and fails with retriable again.
Should not complete yet
+ // Make the first request fail with a retriable error. Should not
complete yet
// given that the request timeout hasn't expired.
time.sleep(retryBackoffMs);
completeOffsetCommitRequestWithError(commitRequestManager,
Errors.REQUEST_TIMED_OUT);
assertFalse(commitResult.isDone());
// Sleep to expire the request timeout. Request should fail on the
next poll.
time.sleep(retryBackoffMs);
- NetworkClientDelegate.PollResult res =
commitRequestManager.poll(time.milliseconds());
- assertEquals(0, res.unsentRequests.size());
+ completeOffsetCommitRequestWithError(commitRequestManager,
Errors.REQUEST_TIMED_OUT);
Review Comment:
uhm this is exactly my concern on [comment
above](https://github.com/apache/kafka/pull/16031/files#r1624689065). Before
this PR poll would throw timeout because it knows that the call to commitSync
had a deadline that expired. Now it requires a response to the request saying
that it timed out. Same outcome, but it needs to sit and wait for something it
already knows.
--
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]