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

Compression handling has some issues #2767

Open
jhump opened this issue May 30, 2024 · 0 comments
Open

Compression handling has some issues #2767

jhump opened this issue May 30, 2024 · 0 comments

Comments

@jhump
Copy link
Member

jhump commented May 30, 2024

According to the gRPC docs for compression, when a client or server sends a “grpc-encoding” header with an unrecognized/unsupported encoding the recipient MUST report that as an error. A client receiving an unsupported encoding from a server should report an internal error code.(See bullet 5 in the test cases section of that doc.) A server receiving an unsupported encoding from a client should report an unimplemented error code. (See bullet 4 in the test cases section of that doc.)

Similarly, when a message is sent where the envelope has the “compressed” bit set, but there is no encoding for the stream (or the encoding is “identity”), the recipient MUST fail with an internal error code.

The client in this package returns an unknown status (with an empty error message) in both of these situations instead of internal.

The server in this package does not necessarily produce any error for either of these:

  • When the server receives an unsupported encoding, it does nothing and will succeed if there are no actual messages in the stream with the compressed bit set.
  • When the server receives an unsupported encoding and encounters a compressed message, it closes the connection. Clients observe an unavailable error due to the loss of network connection.
  • When a server receives a message with the compressed bit set, but no compression (encoding header is absent or set to “identity”), the server ignores the flag. If the compressed payload can successfully be parsed as a Protobuf, the RPC can succeed (though the message is surely invalid).
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