Skip to content
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 client reports the wrong status code if server response contains an unsupported encoding #6987

Open
jhump opened this issue Feb 16, 2024 · 1 comment

Comments

@jhump
Copy link
Member

jhump commented Feb 16, 2024

According to the gRPC docs for compression, when a server sends a response using an unrecognized/unsupported encoding the client MUST report the error with an "internal" error code. (See bullet 5 in the test cases section of that doc.)

The reverse case (client sends a request using an encoding not supported by the server) on the other hand must use an "unimplemented" error.

In grpc-go, both of the above situations result in an "unimplemented" error. Receiving messages in both the client and server runs through the checkRecvPayload function in rpc_util.go which always returns "unimplemented". It should instead have a condition so that it returns "internal" when called from a client.

@dfawley
Copy link
Member

dfawley commented Feb 28, 2024

That [your assessment of the bug] sounds right to me. If the client uses UNIMPLEMENTED in this case, it could be confused with the method not being implemented on the server.

Note that this scenario is missing from https://github.com/grpc/grpc/blob/master/doc/statuscodes.md

@dfawley dfawley removed their assignment Feb 28, 2024
@dfawley dfawley added the P2 label Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants