Skip to content
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

runtime: remove runtime flag envoy.reloadable_features.abort_filter_chain_on_stream_reset #35405

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions changelogs/current.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ removed_config_or_runtime:
- area: tls
change: |
Removed runtime flag ``envoy.reloadable_features.ssl_transport_failure_reason_format``.
- area: http
change: |
Removed runtime flag ``envoy.reloadable_features.abort_filter_chain_on_stream_reset`` and legacy
code path.

new_features:
- area: tls
Expand Down
15 changes: 6 additions & 9 deletions source/common/http/filter_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1743,15 +1743,12 @@ void ActiveStreamEncoderFilter::responseDataDrained() {

void FilterManager::resetStream(StreamResetReason reason,
absl::string_view transport_failure_reason) {
if (Runtime::runtimeFeatureEnabled(
"envoy.reloadable_features.abort_filter_chain_on_stream_reset")) {
// Stop filter chain iteration if stream is reset while filter decoding or encoding callbacks
// are running.
if (state_.filter_call_state_ & FilterCallState::IsDecodingMask) {
state_.decoder_filter_chain_aborted_ = true;
} else if (state_.filter_call_state_ & FilterCallState::IsEncodingMask) {
state_.encoder_filter_chain_aborted_ = true;
}
// Stop filter chain iteration if stream is reset while filter decoding or encoding callbacks
// are running.
if (state_.filter_call_state_ & FilterCallState::IsDecodingMask) {
state_.decoder_filter_chain_aborted_ = true;
} else if (state_.filter_call_state_ & FilterCallState::IsEncodingMask) {
state_.encoder_filter_chain_aborted_ = true;
}

filter_manager_callbacks_.resetStream(reason, transport_failure_reason);
Expand Down
1 change: 0 additions & 1 deletion source/common/runtime/runtime_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
// If issues are found that require a runtime feature to be disabled, it should be reported
// ASAP by filing a bug on github. Overriding non-buggy code is strongly discouraged to avoid the
// problem of the bugs being found after the old code path has been removed.
RUNTIME_GUARD(envoy_reloadable_features_abort_filter_chain_on_stream_reset);
RUNTIME_GUARD(envoy_reloadable_features_avoid_zombie_streams);
RUNTIME_GUARD(envoy_reloadable_features_check_switch_protocol_websocket_handshake);
RUNTIME_GUARD(envoy_reloadable_features_conn_pool_delete_when_idle);
Expand Down
43 changes: 0 additions & 43 deletions test/integration/filter_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1234,25 +1234,6 @@ TEST_P(FilterIntegrationTest, ResetFilter) {
EXPECT_FALSE(response->complete());
}

// Verify filters can reset the stream
TEST_P(FilterIntegrationTest, ResetFilterWithRuntimeFlagFalse) {
config_helper_.addRuntimeOverride("envoy.reloadable_features.abort_filter_chain_on_stream_reset",
"false");

// Make the add-body-filter stop iteration from encodeData. Headers should be sent to the client.
prependFilter(R"EOF(
name: reset-stream-filter
)EOF");

initialize();
codec_client_ = makeHttpConnection(lookupPort("http"));

IntegrationStreamDecoderPtr response =
codec_client_->makeHeaderOnlyRequest(default_request_headers_);
ASSERT_TRUE(response->waitForReset());
EXPECT_FALSE(response->complete());
}

// Verify filters can reset the stream
TEST_P(FilterIntegrationTest, EncoderResetFilter) {
// Make the add-body-filter stop iteration from encodeData. Headers should be sent to the client.
Expand All @@ -1275,30 +1256,6 @@ TEST_P(FilterIntegrationTest, EncoderResetFilter) {
EXPECT_FALSE(response->complete());
}

TEST_P(FilterIntegrationTest, EncoderResetFilterWithRuntimeFlagFalse) {
config_helper_.addRuntimeOverride("envoy.reloadable_features.abort_filter_chain_on_stream_reset",
"false");

// Make the add-body-filter stop iteration from encodeData. Headers should be sent to the client.
prependFilter(R"EOF(
name: encoder-reset-stream-filter
)EOF");
initialize();
codec_client_ = makeHttpConnection(lookupPort("http"));

IntegrationStreamDecoderPtr response =
codec_client_->makeHeaderOnlyRequest(default_request_headers_);

// Accept request and send response.
waitForNextUpstreamRequest(0);
Http::TestResponseHeaderMapImpl response_headers{{":status", "200"}};
upstream_request_->encodeHeaders(response_headers, true);

// The stream will be in the response path.
ASSERT_TRUE(response->waitForReset());
EXPECT_FALSE(response->complete());
}

TEST_P(FilterIntegrationTest, EncoderResetFilterAndContinue) {
// Make the add-body-filter stop iteration from encodeData. Headers should be sent to the client.
prependFilter(R"EOF(
Expand Down