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

Servers send grpc-message trailer even when no error #2769

Open
jhump opened this issue May 30, 2024 · 1 comment
Open

Servers send grpc-message trailer even when no error #2769

jhump opened this issue May 30, 2024 · 1 comment

Comments

@jhump
Copy link
Member

jhump commented May 30, 2024

The gRPC protocol spec has this to say about the “grpc-message” trailer, which is optional (unlike “grpc-status”):

The value portion of Status-Message is conceptually a Unicode string description of the error

So when there is no error (i.e. the “grpc-status” trailer value is “0”), it is incorrect to include this; there is no error for such a string to describe.

The server in this repo always emits a “grpc-message” trailer, even on success. The source of the message should be the application, which indicates both the status code and the message when errors occur. But in this case, the application has not actually indicated an error message. The string “OK” gets used unconditionally for the value of this trailer.

FWIW, this behavior differs from the behavior of other gRPC implementations (C++, Java, and Go), which only include such a trailer for errors. I think their behavior is correct per my interpretation of the spec.

@murgatroid99
Copy link
Member

The spec doesn't say that it is incorrect to include the message with an OK status. At most, it implies that it is unnecessary to do so.

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