-
Notifications
You must be signed in to change notification settings - Fork 505
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
gRPC Runtime throws Scala NotImplementedError when handling trailers-only response #2378
Comments
thanks @jlawrienyt for this detailed description. We'll start looking in to this |
Thanks @jlawrienyt! Nice find, and good work digging into the code. I think you assessment is totally right. The way I would think about fixing this would be to make a change in the Here we have the HTTP response and we can check if it's a trailers-only message (i.e. the stream is empty). If so, we can return the gRPC status as an exception. |
@jlawrienyt is this a fix you'd be interested in submitting? Happy to provide further guidance if that would be helpful. |
@adleong yes, I should have something up by end of day. |
Fixed by #2379 |
Thanks for your help improving the project!
Getting Help
Github issues are for bug reports and feature requests. For questions about
Linkerd, how to use it, or debugging assistance, start by
asking a question in the forums or join us on
Slack.
Full details at CONTRIBUTING.md.
Filing a Linkerd issue
Issue Type:
What happened:
When receiving a trailers-only gRPC response with a Non-OK gRPC status for a unary to unary or stream to unary RPC, a failed Future is returned containing a Scala
NotImplementedError
.What you expected to happen:
I expected to receive a failed Future containing a Non-Ok
GrpcStatus
instance.How to reproduce it (as minimally and precisely as possible):
Connect to a gRPC service that can reliably produce a Non-OK, trailers-only (i.e. a single Headers frame with EOS set to true) response; observe the Scala
NotImplementedError
.Anything else we need to know?:
I've tracked down the issue to an interaction between the H2 Netty4StreamTransport, where it sets an empty
Stream
when it receives as its first Frame in the H2 Stream a headers withEOS
set totrue
; and the gRPC Codec which always attempts to read from the stream without first checking whether or not it is empty. TheNotImplementedError
is present theread
method implementation for empty Streams.As a temporary workaround, I'm intercepting h2.Response instances before they are handled by the gRPC Codec and converting them from
Stream.empty
to a Stream with a single Trailers Frame created fromResponse.headers
.Environment:
grpc-runtime
andfinagle-h2
dependencies. Note I'm observing this in an application that does not use the Linkerd service mesh, rather is a Finagle application using thegrpc-runtime
for connecting directly to a gRPC service. I looked through the code and didn't find anywhere outside ofgrpc-runtime
where this is being handled so I think it would affect any proxying of gRPC services as well, but can't be sure.The text was updated successfully, but these errors were encountered: