Do not expose gRPC trailers in the gRPC bridge #6690
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
References grpc/grpc-go#6662
References grpc-ecosystem/grpc-gateway#3725
This PR stops our RPCs from propagating trailers from the gRPC calls to the HTTP clients. It does so because we don't use trailers in general, and it would be better to do it on a whitelist basis anyway.
Second, it fixes a bug caused by the above linked
grpc-go
change, which adds a binary-valued trailer to RPCs which have errored out. The binary value makes some callers (specifically, Firefox) to timeout the request. Generally this agrpc-gateway
issue (probably the header should be re-encoded as base64, which is the inbound behavior anyway), but we don't have any reason to propagate the error header anyway, since the error details are provided in the response body.Changes
grpc-gateway
until the changes are accepted upstream.Testing
Local testing. Basically any API call done from Firefox which fails will cause this issue.
There are no special steps required to test this issue - if you can login into the Console, and go to the gateways page and see that a gateway is disconnected, you're good to go.
Regressions
This new filtering policy will stop any trailers from being propagated. Fundamentally we don't use trailers in our RPC server implementations, so I am optimistic that we're not regressing anything.
Checklist
README.md
for the chosen target branch.CHANGELOG.md
.CONTRIBUTING.md
, there are no fixup commits left.