-
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
Inconsistent INTERNAL errors for message-less RPCs #2785
Comments
@ejona86 I see you had a similar issue here grpc/grpc#8010 which makes it sound like servers should always call onNext() for a unary response, but don't need to for streaming responses? |
related #2770 |
A "stream" is zero-to-many messages, so no call to onNext() is valid. Unary must either error or have a message. It seems like there are two issues:
@jhspaybar, does that sound okay? |
See also #2243. This is sort of a dup, and sort of not. Leaving open for the moment. |
@ejona86 another one for us to close.. |
What version of gRPC are you using?
1.0.3
What JVM are you using (
java -version
)?java version "1.8.0_121"
What did you do?
Create a unary rpc, on the server have it immediately call responseObserver.onCompleted() with no previous onNext(). With a java gRPC client call this rpc with blocking and future stubs, they'll both throw an INTERNAL error from here
grpc-java/stub/src/main/java/io/grpc/stub/ClientCalls.java
Line 434 in 89bc2cd
If I switched to a streaming response and called onComplete() on with no previous onNext() the future stub is no longer available(expected) and now the Iterable for the blocking stub returns false for hasNext() as expected, but doesn't break. The async stub continues working as before.
What did you expect to see?
I guess I wanted the "defaultInstance" of the response type for the blocking and future based stubs rather than an exception. That, or an onError to trigger on the async stub with the same INTERNAL status and message.
I have not checked what the c-core will do in this case, or if there is a spec for this behavior.
The text was updated successfully, but these errors were encountered: