philipnee commented on code in PR #14532:
URL: https://github.com/apache/kafka/pull/14532#discussion_r1361282001


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/HeartbeatRequestManager.java:
##########
@@ -184,13 +184,11 @@ private NetworkClientDelegate.UnsentRequest 
makeHeartbeatRequest() {
         NetworkClientDelegate.UnsentRequest request = new 
NetworkClientDelegate.UnsentRequest(
             new ConsumerGroupHeartbeatRequest.Builder(data),
             coordinatorRequestManager.coordinator());
-        request.future().whenComplete((response, exception) -> {
+        request.handler().whenComplete((response, exception) -> {
             if (response != null) {
                 onResponse((ConsumerGroupHeartbeatResponse) 
response.responseBody(), response.receivedTimeMs());
             } else {
-                // TODO: Currently, we lack a good way to propage the response 
time from the network client to the
-                //  request handler. We will need to store the response time 
in the handler to make it accessible.
-                onFailure(exception, time.milliseconds());
+                onFailure(exception, request.handler().completionTimeMs());

Review Comment:
   The future may be completed exceptionally with an exception, or get 
completed with a response and an error code.  Is this where the confusion comes 
from? As retriable exception can be thrown in both response as well as the 
throwable part. 
   
   Should I make onComplete to accept both the error and the response? like 
void onComplete(ClientResponse response, Throwable error); to be more 
consistent?



-- 
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-unsubscr...@kafka.apache.org

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

Reply via email to