-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ClientCall errors does not finally invoke ClientCall.Listener.onClose() #5576
Comments
ejona86
added a commit
to ejona86/grpc-java
that referenced
this issue
Apr 10, 2019
Interceptors need to see the onClose to clean up properly. This also changes an isInterrupted() to interrupted(), since previously the interrupted flag was still set when InterruptedException was thrown. This caused an infinite loop with the new code. Previously, all callers immediately re-set the interrupted flag, so there was no issue. Fixes grpc#5576
ejona86
added a commit
that referenced
this issue
Apr 22, 2019
Interceptors need to see the onClose to clean up properly. This also changes an isInterrupted() to interrupted(), since previously the interrupted flag was still set when InterruptedException was thrown. This caused an infinite loop with the new code. Previously, all callers immediately re-set the interrupted flag, so there was no issue. Fixes #5576
Fix was reverted in #5641 |
See cl/245431681 for information about the failing test. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Please answer these questions before submitting your issue.
What version of gRPC are you using?
v1.19.0
What did you expect to see?
ClientCall.Listener.onClose()
should be invoked when there is a ClientCall error for unary calls.When there is an exception thrown by
call.sendMessage()
orcall.halfClose()
withinasyncUnaryRequestCall()
(See https://sourcegraph.com/github.com/grpc/grpc-java/-/blob/stub/src/main/java/io/grpc/stub/ClientCalls.java#L276:37), it results incancelThrow()
callingClientCall.cancel()
and scheduling a stream closed task (i.e.ClientCall.Listener.onClose
) on the executor. However, the exception propagates up tofutureUnaryCall
andblockingUnaryCall
which catches it again, callscancelThrow()
again but never drains the executor within the try-catch block (See https://sourcegraph.com/github.com/grpc/grpc-java/-/blob/stub/src/main/java/io/grpc/stub/ClientCalls.java#L123-146). ThusClientCall.cancel()
is called but notClientCall.Listener.onClose()
on client call errors.Is
ClientCall.Listener.onClose()
expected to be called whenever the client call terminates? Is dropping theClientCall.Listener.onClose()
call a bug or expected behaviour?The text was updated successfully, but these errors were encountered: