Skip to content

reverse bridge: use local reply instead of ContinueAndEndStream#13205

Merged
snowp merged 3 commits intoenvoyproxy:masterfrom
snowp:reverse-local-reply
Sep 24, 2020
Merged

reverse bridge: use local reply instead of ContinueAndEndStream#13205
snowp merged 3 commits intoenvoyproxy:masterfrom
snowp:reverse-local-reply

Conversation

@snowp
Copy link
Copy Markdown
Contributor

@snowp snowp commented Sep 21, 2020

Instead of returning ContinueAndEndStream we can respond with a local
reply. This removes the only use case of ContinueAndEndStream in
non-test code.

Signed-off-by: Snow Pettersen snowp@lyft.com

Risk Level: Medium (changes the set of headers returned)
Testing: Existing tests
Docs Changes: n/a
Release Notes: n/a

Instead of returning ContinueAndEndStream we can respond with a local
reply. This removes the only use case of ContinueAndEndStream in
non-test code.

Signed-off-by: Snow Pettersen <snowp@lyft.com>
@snowp snowp requested a review from zuercher as a code owner September 21, 2020 20:08
@snowp
Copy link
Copy Markdown
Contributor Author

snowp commented Sep 21, 2020

Some context: https://envoyproxy.slack.com/archives/C78HA81DH/p1600707354050600

tl;dr this will let us remove ContinueAndEndStream and reduce some of the complexity of the HCM

Snow Pettersen added 2 commits September 21, 2020 20:11
Signed-off-by: Snow Pettersen <snowp@lyft.com>
Signed-off-by: Snow Pettersen <snowp@lyft.com>
}
decoder_callbacks_->sendLocalReply(Http::Code::OK, badContentTypeMessage(headers), nullptr,
Grpc::Status::WellKnownGrpcStatus::Unknown,
RcDetails::get().GrpcBridgeFailedContentType);
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.

I think this ends up setting content-type of the response to text unless the http connection manager's local_reply_config is configured with a mapper that matches and sets content-type.

Assuming that's correct, I think that's worth mentioning (or linking to docs) in the release notes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this would piggy back on the default local reply handling for gRPC and hit this code: https://github.com/envoyproxy/envoy/blob/master/source/common/http/utility.cc#L476-L492

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.

Ah. Was looking for that but didn't find it.

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.

A little late to this but do we have a integration test that covers this case? I'm slightly concerned about the sendLocalReply path having very little testing when called in the encoding path. cc @alyssawilk @snowp

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I thought we did but now that I look into it I see that there isn't, and while adding one it seems like we're hitting some ASSERT. I'll see if I can come up with a quick fix, if not I'll revert this PR.

@snowp
Copy link
Copy Markdown
Contributor Author

snowp commented Sep 23, 2020

ping @zuercher, lmk if you still think there is a need for additional release note information

@snowp snowp merged commit 07f7c59 into envoyproxy:master Sep 24, 2020
snowp pushed a commit to snowp/envoy that referenced this pull request Sep 24, 2020
…am (envoyproxy#13205)"

This reverts commit 07f7c59.

Signed-off-by: Snow Pettersen <snowp@lyft.com>
mattklein123 pushed a commit that referenced this pull request Sep 24, 2020
…am (#13205)" (#13262)

This reverts commit 07f7c59.

Signed-off-by: Snow Pettersen <snowp@lyft.com>
snowp pushed a commit to snowp/envoy that referenced this pull request Oct 6, 2020
…dEndStream (envoyproxy#13205)""

This reverts commit b1e8cfd.

Signed-off-by: Snow Pettersen <snowp@lyft.com>
snowp pushed a commit to snowp/envoy that referenced this pull request Oct 6, 2020
…yproxy#13205)

Instead of returning ContinueAndEndStream we can respond with a local
reply. This removes the only use case of ContinueAndEndStream in
non-test code.

Signed-off-by: Snow Pettersen <snowp@lyft.com>
mattklein123 pushed a commit that referenced this pull request Oct 6, 2020
…) (#13414)

Instead of returning ContinueAndEndStream we can respond with a local
reply. This removes the only use case of ContinueAndEndStream in
non-test code.

Signed-off-by: Snow Pettersen <snowp@lyft.com>
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