Repository navigation
Separate state for tracking downstream end_stream in filter manager and HCM - #35815
Merged
Merged
Conversation
…nd HCM Signed-off-by: Yan Avlasov <[email protected]>
RyanTheOptimist
previously approved these changes
Aug 22, 2024
RyanTheOptimist
left a comment
Contributor
There was a problem hiding this comment.
Wow, great catch! LGTM
| } else { | ||
| // Save trailers in a different variable since `request_trailers_` is available to the filter | ||
| // manager via `requestTrailers()` callback and makes filter manager see trailers prematurely | ||
| // when deferred request is processed. |
Contributor
There was a problem hiding this comment.
Nice comment! Thanks for adding this.
yanavlasov
enabled auto-merge (squash)
August 23, 2024 13:14
Signed-off-by: Yan Avlasov <[email protected]>
KBaichoo
previously approved these changes
Aug 23, 2024
Signed-off-by: Yan Avlasov <[email protected]>
KBaichoo
approved these changes
Aug 23, 2024
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.
Commit Message:
Fix two bugs in processing of deferred requests.
For example if a filter pauses in decodeHeaders() and then resumes in decodeData() all filters after that will have decodeHeaders() called with end_stream == true. This can cause request to be proxied by the router without the body.
The same problem is also present when HCM recreates the stream with body (i.e. for internal redirect).
This change makes filter manager use its own, already existing, flag
observed_decode_end_stream_for tracking state of downstream end_stream flag when resuming the filter chain, instead of the timestamp of the end_stream receipt from downstream client.HCM continues to use the presence of the end_stream timestamp as the indicator of completed client's stream.
This change can be reverted by setting the envoy.reloadable_features.use_filter_manager_state_for_downstream_end_stream runtime flag to false.
Risk Level: Medium, affects deferred request processing
Testing: Unit tests
Docs Changes: N/A
Release Notes: Yes
Platform Specific Features: N/A
Runtime guard: envoy.reloadable_features.use_filter_manager_state_for_downstream_end_stream
Fixes #35814