kirktrue commented on code in PR #16031:
URL: https://github.com/apache/kafka/pull/16031#discussion_r1626759656


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -875,8 +872,12 @@ private void handleClientResponse(final ClientResponse 
response,
 
         abstract void onResponse(final ClientResponse response);
 
-        boolean retryTimeoutExpired(long currentTimeMs) {
-            return expirationTimeMs.isPresent() && expirationTimeMs.get() <= 
currentTimeMs;
+        /**
+         * If at least one attempt has been sent, and the user-provided 
timeout has elapsed, consider the
+         * request as expired.
+         */
+        boolean retryTimeoutExpired() {

Review Comment:
   ...and folding the checks into the caller directly.



##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -516,8 +527,9 @@ private void fetchOffsetsWithRetries(final 
OffsetFetchRequestState fetchRequest,
                 result.complete(res);
             } else {
                 if (error instanceof RetriableException || 
isStaleEpochErrorAndValidEpochAvailable(error)) {
-                    if (error instanceof TimeoutException && 
fetchRequest.isExpired) {
-                        result.completeExceptionally(error);
+                    if (fetchRequest.isExpired()) {
+                        log.debug("Fetch request for {} timed out and won't be 
retried anymore", fetchRequest.requestedPartitions);

Review Comment:
   Done.



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