Skip to content

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

Merged
jhump merged 2 commits intoconnectrpc:mainfrom
StatelyCloud:status-details
Mar 19, 2024
Merged

Only send a serialized Status in the gRPC protocol if it has details#713
jhump merged 2 commits intoconnectrpc:mainfrom
StatelyCloud:status-details

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?

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.

@jhump jhump merged commit 90df12f into connectrpc:main Mar 19, 2024
@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