Skip to content

Commit

Permalink
overload: remove runtime override for http/2 goaway (envoyproxy#16041)
Browse files Browse the repository at this point in the history
Remove deprecated runtime override
envoy.reloadable_features.overload_manager_disable_keepalive_drain_http2.
Multiplexing HTTP connections (HTTP/2, HTTP/3) will always be sent a
GOAWAY when the overload action for disabling connection keepalive
triggers.

Signed-off-by: Alex Konradi <[email protected]>
Signed-off-by: Gokul Nair <[email protected]>
  • Loading branch information
akonradi authored and Gokul Nair committed May 6, 2021
1 parent 8f56e48 commit 359363e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 27 deletions.
1 change: 1 addition & 0 deletions docs/root/version_history/current.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Removed Config or Runtime
-------------------------
*Normally occurs at the end of the* :ref:`deprecation period <deprecated>`

* http: removed `envoy.reloadable_features.overload_manager_disable_keepalive_drain_http2`; Envoy will now always send GOAWAY to HTTP2 downstreams when the :ref:`disable_keepalive <config_overload_manager_overload_actions>` overload action is active.
* tls: removed `envoy.reloadable_features.tls_use_io_handle_bio` runtime guard and legacy code path.

New Features
Expand Down
6 changes: 1 addition & 5 deletions source/common/http/conn_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1362,11 +1362,7 @@ void ConnectionManagerImpl::ActiveStream::encodeHeaders(ResponseHeaderMap& heade
connection_manager_.random_generator_.bernoulli(
connection_manager_.overload_disable_keepalive_ref_.value())) {
ENVOY_STREAM_LOG(debug, "disabling keepalive due to envoy overload", *this);
if (connection_manager_.codec_->protocol() < Protocol::Http2 ||
Runtime::runtimeFeatureEnabled(
"envoy.reloadable_features.overload_manager_disable_keepalive_drain_http2")) {
drain_connection_due_to_overload = true;
}
drain_connection_due_to_overload = true;
connection_manager_.stats_.named_.downstream_cx_overload_disable_keepalive_.inc();
}

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 @@ -80,7 +80,6 @@ constexpr const char* runtime_features[] = {
"envoy.reloadable_features.http2_skip_encoding_empty_trailers",
"envoy.reloadable_features.improved_stream_limit_handling",
"envoy.reloadable_features.internal_redirects_with_body",
"envoy.reloadable_features.overload_manager_disable_keepalive_drain_http2",
"envoy.reloadable_features.prefer_quic_kernel_bpf_packet_routing",
"envoy.reloadable_features.preserve_downstream_scheme",
"envoy.reloadable_features.remove_forked_chromium_url",
Expand Down
25 changes: 4 additions & 21 deletions test/common/http/conn_manager_impl_test_2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2187,31 +2187,17 @@ TEST_F(HttpConnectionManagerImplTest, DisableHttp1KeepAliveWhenOverloaded) {
EXPECT_EQ(1U, stats_.named_.downstream_cx_overload_disable_keepalive_.value());
}

class DrainH2HttpConnectionManagerImplTest : public HttpConnectionManagerImplTest,
public testing::WithParamInterface<bool> {
public:
DrainH2HttpConnectionManagerImplTest() {
Runtime::LoaderSingleton::getExisting()->mergeValues(
{{"envoy.reloadable_features.overload_manager_disable_keepalive_drain_http2", "true"}});
}

private:
TestScopedRuntime runtime_;
};

// Verify that, if the runtime option is enabled, HTTP2 connections will receive
// a GOAWAY message when the overload action is triggered.
TEST_P(DrainH2HttpConnectionManagerImplTest, DisableHttp2KeepAliveWhenOverloaded) {
// Verify that HTTP2 connections will receive a GOAWAY message when the overload action is
// triggered.
TEST_F(HttpConnectionManagerImplTest, DisableHttp2KeepAliveWhenOverloaded) {
Server::OverloadActionState disable_http_keep_alive = Server::OverloadActionState::saturated();
ON_CALL(overload_manager_.overload_state_,
getState(Server::OverloadActionNames::get().DisableHttpKeepAlive))
.WillByDefault(ReturnRef(disable_http_keep_alive));

codec_->protocol_ = Protocol::Http2;
setup(false, "");
if (GetParam()) {
EXPECT_CALL(*codec_, shutdownNotice);
}
EXPECT_CALL(*codec_, shutdownNotice);

std::shared_ptr<MockStreamDecoderFilter> filter(new NiceMock<MockStreamDecoderFilter>());
EXPECT_CALL(filter_factory_, createFilterChain(_))
Expand Down Expand Up @@ -2244,9 +2230,6 @@ TEST_P(DrainH2HttpConnectionManagerImplTest, DisableHttp2KeepAliveWhenOverloaded
EXPECT_EQ(1, stats_.named_.downstream_cx_overload_disable_keepalive_.value());
}

INSTANTIATE_TEST_SUITE_P(WithRuntimeOverride, DrainH2HttpConnectionManagerImplTest,
testing::Bool());

TEST_F(HttpConnectionManagerImplTest, TestStopAllIterationAndBufferOnDecodingPathFirstFilter) {
setup(false, "envoy-custom-server", false);
setUpEncoderAndDecoder(true, true);
Expand Down

0 comments on commit 359363e

Please sign in to comment.