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

Only send a serialized Status in the gRPC protocol if it has details #713

Merged
merged 2 commits into from
Mar 19, 2024

Conversation

bhollis
Copy link
Contributor

@bhollis bhollis commented Mar 18, 2024

Currently, in the gRPC protocol, Connect will always serialize a Status proto and return it in the Grpc-Status-Details-Bin header. This differs from the grpc-go behavior, which is to only emit that header if the Status has a non-empty Details list. The remaining properties of Status (message and code) are still returned via dedicated headers, so returning the encoded Status message is redundant.

This PR aligns Connect's gRPC protocol with the grpc-go behavior, which also reduces the wire size of error responses in the common case that no details are provided. I chose not to match their behavior of panicing when marshalling fails 😉 .

@CLAassistant
Copy link

CLAassistant commented Mar 18, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@jhump jhump left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. I'll run the CI workflows to make sure everything passes the test and lint jobs. @emcfarlane, any thoughts or concerns?

protocol_grpc.go Outdated Show resolved Hide resolved
connect_ext_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@emcfarlane emcfarlane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! Minor comments, thanks.

connect_ext_test.go Outdated Show resolved Hide resolved
protocol_grpc.go Outdated Show resolved Hide resolved
protocol_grpc.go Outdated Show resolved Hide resolved
@jhump jhump merged commit 90df12f into connectrpc:main Mar 19, 2024
12 checks passed
@bhollis bhollis deleted the status-details branch March 19, 2024 20:10
@jhump jhump added the enhancement New feature or request label Mar 20, 2024
@jhump jhump mentioned this pull request Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants