Skip to content

http: unifying grpc local reply logic - #13038

Merged
alyssawilk merged 1 commit into
envoyproxy:masterfrom
alyssawilk:grpc
Sep 14, 2020
Merged

alyssawilk merged 1 commit into
envoyproxy:masterfrom
alyssawilk:grpc

Conversation

@alyssawilk

Copy link
Copy Markdown
Contributor

Additional Description:
Prior to this PR, if a non-gRPC request came in to Envoy, filter A turned it into a gRPC request, filter B switched it back, the response sent would be a gRPC response if sent from A, and a non-gRPC response if sent from B, and maybe gRPC maybe not if sent by the router or HCM (depending on the current state of the headers).

This seems unnecessarily complex as all response always traverse the full filter chain, so this PR unifies the response based on the original downstream request. If a request comes in as gRPC and is transformed to not-gRPC, sendLocalReply will now always send a gRPC response. If a request comes in as not gRPC and is transformed to gRPC, sendLocalReply will always send a non-gRPC response.

Risk Level: medium (changes to L7 processing)
Testing: gRPC json test reflects plaintext response
Docs Changes: n/a
Release Notes: inline
Runtime guard: envoy.reloadable_features.unify_grpc_handling

Signed-off-by: Alyssa Wilk <[email protected]>
@alyssawilk

Copy link
Copy Markdown
Contributor Author

@snowp you up for first pass? This was motivated by that sendLocalReply clean up we both want and can't do for 6 months.
I'll tag Matt once it has your OK :-)

snowp
snowp previously requested changes Sep 13, 2020

@snowp snowp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks this looks right to me. Do we want a HCM/FM test that explicitly tests this or does the transcoder test suffice?

@alyssawilk

Copy link
Copy Markdown
Contributor Author

I'm fine with the transcoder test but LMK if you want a separate unit test.

@mattklein123 mattklein123 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice cleanup!

@alyssawilk
alyssawilk dismissed snowp’s stale review September 14, 2020 18:38

current test suffices

@alyssawilk
alyssawilk merged commit 49b316e into envoyproxy:master Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants