http conn man: stopped filters can add data from encodeTrailers#8404
Merged
mattklein123 merged 3 commits intoenvoyproxy:masterfrom Oct 1, 2019
Merged
Conversation
Now filters can return StopIteration from encodeHeaders, and then call addEncodedData from encodeTrailers. This allows the JsonTranscoderFilter to properly transcode gRPC status in trailer headers into a JSON reply body. Risk Level: Low Testing: unit-tests, integration tests in gRPC JSON transcoder filter. Documentation: n/a Release notes: n/a Fixes envoyproxy#8402 Signed-off-by: Anatoly Scheglov <ascheglov@yandex-team.ru>
mattklein123
requested changes
Sep 27, 2019
Member
mattklein123
left a comment
There was a problem hiding this comment.
Thanks for this change and all of the tests. This makes sense to me. Can you make a parallel change in the decode path as well? Thank you!
/wait
Signed-off-by: Anatoly Scheglov <ascheglov@yandex-team.ru>
mattklein123
requested changes
Sep 30, 2019
Member
mattklein123
left a comment
There was a problem hiding this comment.
Thanks looks great. One additional test request. Thank you!
/wait
| EXPECT_CALL(*decoder_filters_[0], decodeTrailers(_)) | ||
| .WillOnce(InvokeWithoutArgs([&]() -> FilterTrailersStatus { | ||
| decoder_filters_[0]->callbacks_->addDecodedData(trailers_data, false); | ||
| return FilterTrailersStatus::Continue; |
Member
There was a problem hiding this comment.
Can you add a similar parallel test in which the filter decode/encodeTrailers() callbacks continue to stop iteration and then do a continuation later outside of callback context?
Signed-off-by: Anatoly Scheglov <ascheglov@yandex-team.ru>
mattklein123
approved these changes
Oct 1, 2019
Member
mattklein123
left a comment
There was a problem hiding this comment.
Awesome work, thank you!
danzh2010
pushed a commit
to danzh2010/envoy
that referenced
this pull request
Oct 4, 2019
…yproxy#8404) Now filters can return StopIteration from encodeHeaders, and then call addEncodedData from encodeTrailers. This allows the JsonTranscoderFilter to properly transcode gRPC status in trailer headers into a JSON reply body. Risk Level: Low Testing: unit-tests, integration tests in gRPC JSON transcoder filter. Documentation: n/a Release notes: n/a Fixes envoyproxy#8402 Signed-off-by: Anatoly Scheglov <ascheglov@yandex-team.ru>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Now filters can return StopIteration from encodeHeaders,
and then call addEncodedData from encodeTrailers.
This allows the JsonTranscoderFilter to properly transcode gRPC status
in trailer headers into a JSON reply body.
Risk Level: Low
Testing: manual testing, unit-tests, integration tests in gRPC JSON transcoder filter.
Documentation: n/a
Release notes: n/a
Fixes #8402