Can ClientCall.Listener.onClose() ever run after asyncUnaryCall completes. #12234
Unanswered
catchpolecanva
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We use a
ClientInterceptor
with aSimpleForwardingClientCallListener
to track call latency and other various metrics for gRPC calls. Under some circumstances, we notice that our latencies blow out from a typical50 ms
, up to2000 ms
. I accept that there are all sorts of reasons for delayed requests on a large busy system, especially with load balancers involved. The time of our actual server method call does not change, nor are there backed up requests etc, so we think it's related to the communications layer, not the call itself.I put an extra timer around whole call, from the caller's perspective. I'm seeing initial metrics which suggest that the time observed by the caller of the method is in the expected range but sometimes the time recorded by
ClientCall.Listener.onClose()
is much higher.If I put a
sleep
inonClose
I can see it delays the whole call, so this suggests it's not runningasync
, or at least not by default.My question is simply, are their circumstances where gRPC internally will allow the
asyncUnaryCall
to complete before it has runClientCall.Listener.onClose()
from aClientInterceptor
?My metrics suggest this can happen, but there is also the possibility my metrics are inaccurate.
Beta Was this translation helpful? Give feedback.
All reactions