-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
What version of gRPC-Java are you using?
1.61.1
What is your environment?
MacOS 13.6.4, Oracle OpenJDK version 21.0.2
What did you expect to see?
RPC should return an internal error (code 13)
What did you see instead?
RPC returns a canceled error (code 1)
Steps to reproduce the bug
Send a request one of the message frames has the "compressed" flag set in its 5-byte preface but the current encoding is "identity".
The expectation of an "internal" error comes from the set of test cases at the bottom of this doc on gRPC compression: https://github.com/grpc/grpc/blob/master/doc/compression.md#test-cases:
An ill-constructed message with its Compressed-Flag bit set but lacking a grpc-encoding entry different from identity in its metadata MUST fail with INTERNAL status, its associated description indicating the invalid Compressed-Flag condition.
The grpc-java server is not actually serializing any status exception to trailers in this scenario. Instead, it is sending a RST_STREAM HTTP/2 frame with code CANCEL, which results in the client observing a "CANCELLED" error code.