-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate state for tracking downstream end_stream in filter manager and HCM #35815
Separate state for tracking downstream end_stream in filter manager and HCM #35815
Conversation
…nd HCM Signed-off-by: Yan Avlasov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice comment! Thanks for adding this.
Signed-off-by: Yan Avlasov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
test/integration/filters/stop_in_headers_continue_in_data_filter.cc
Outdated
Show resolved
Hide resolved
Signed-off-by: Yan Avlasov <[email protected]>
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