Details
-
Sub-task
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
Description
Currently, we don't have a good way to propagate the response time to the handler when timeout is thrown.
unsent.handler.onFailure(new TimeoutException( "Failed to send request after " + unsent.timer.timeoutMs() + " ms."));
The current request manager invoke a system call to retrieve the response time, which is not idea because it is already available at network client
This is an example of the coordinator request manager:
unsentRequest.future().whenComplete((clientResponse, throwable) -> { long responseTimeMs = time.milliseconds(); if (clientResponse != null) { FindCoordinatorResponse response = (FindCoordinatorResponse) clientResponse.responseBody(); onResponse(responseTimeMs, response); } else { onFailedResponse(responseTimeMs, throwable); } });
But in the networkClientDelegate, we should utilize the currentTimeMs in the trySend to avoid calling time.milliseconds():
private void trySend(final long currentTimeMs) { ... unsent.handler.onFailure(new TimeoutException( "Failed to send request after " + unsent.timer.timeoutMs() + " ms.")); continue; } }
Attachments
Issue Links
- links to