You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "kirktrue (via GitHub)" <gi...@apache.org> on 2023/08/30 18:34:42 UTC

[GitHub] [kafka] kirktrue commented on a diff in pull request #14305: KAFKA-14274: [1/7] basic refactoring

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


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/RequestState.java:
##########
@@ -66,13 +65,19 @@ public boolean canSendRequest(final long currentTimeMs) {
             return true;
         }
 
-        if (this.lastReceivedMs == -1 ||
-                this.lastReceivedMs < this.lastSentMs) {
-            // there is an inflight request
+        if (this.lastReceivedMs == -1 || this.lastReceivedMs < this.lastSentMs) {
+            log.debug("An inflight request already exists; lastReceivedMs: {}, lastSentMs:  {}", lastReceivedMs, lastSentMs);

Review Comment:
   Hi @philipnee!
   
   That's a good point. This debug logging doesn't have context of the request.
   
   The request manager calls `canSendRequest()` before creating the request, though. So in the cases where we return `false`, there won't be a request, so there isn't any additional request information that the request manager would be able to log.
   
   Additionally, there are two different reasons why a request cannot be sent:
   
   1. There's already an inflight request
   2. The backoff hasn't expired
   
   When `canSendRequest()` returns `false` back to the request manager, we'd lose the context to explain the reason why the request can't be sent.
   
   I'll look into this a bit more to see what I can do.
   
   Thanks!



-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org