Skip to content

Commit 4c55072

Browse files
authored
runtime: remove runtime guard listener_in_place_filterchain_update (envoyproxy#14921)
Fixes: envoyproxy#14647 Signed-off-by: Yuchen Dai <[email protected]>
1 parent 989961f commit 4c55072

File tree

5 files changed

+1
-115
lines changed

5 files changed

+1
-115
lines changed

docs/root/version_history/current.rst

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Removed Config or Runtime
6565
* http: removed legacy connection close behavior and runtime guard `envoy.reloadable_features.fixed_connection_close`.
6666
* http: removed legacy HTTP/1.1 error reporting path and runtime guard `envoy.reloadable_features.early_errors_via_hcm`.
6767
* http: removed legacy sanitization path for upgrade response headers and runtime guard `envoy.reloadable_features.fix_upgrade_response`.
68+
* listener: removed legacy runtime guard `envoy.reloadable_features.listener_in_place_filterchain_update`.
6869
* router: removed `envoy.reloadable_features.consume_all_retry_headers` and legacy code path.
6970

7071
New Features

source/common/runtime/runtime_features.cc

-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ constexpr const char* runtime_features[] = {
7474
"envoy.reloadable_features.http_transport_failure_reason_in_body",
7575
"envoy.reloadable_features.http_upstream_wait_connect_response",
7676
"envoy.reloadable_features.http2_skip_encoding_empty_trailers",
77-
"envoy.reloadable_features.listener_in_place_filterchain_update",
7877
"envoy.reloadable_features.overload_manager_disable_keepalive_drain_http2",
7978
"envoy.reloadable_features.prefer_quic_kernel_bpf_packet_routing",
8079
"envoy.reloadable_features.preserve_query_string_in_path_redirects",

source/server/listener_impl.cc

-5
Original file line numberDiff line numberDiff line change
@@ -713,11 +713,6 @@ void ListenerImpl::setSocketFactory(const Network::ListenSocketFactorySharedPtr&
713713

714714
bool ListenerImpl::supportUpdateFilterChain(const envoy::config::listener::v3::Listener& config,
715715
bool worker_started) {
716-
if (!Runtime::runtimeFeatureEnabled(
717-
"envoy.reloadable_features.listener_in_place_filterchain_update")) {
718-
return false;
719-
}
720-
721716
// The in place update needs the active listener in worker thread. worker_started guarantees the
722717
// existence of that active listener.
723718
if (!worker_started) {

test/server/listener_manager_impl_test.cc

-101
Original file line numberDiff line numberDiff line change
@@ -4845,107 +4845,6 @@ TEST_F(ListenerManagerImplForInPlaceFilterChainUpdateTest,
48454845
EXPECT_EQ(0, server_.stats_store_.counter("listener_manager.listener_in_place_updated").value());
48464846
}
48474847

4848-
// This test execute an in place update first, then a traditional listener update.
4849-
// The second update is enforced by runtime.
4850-
TEST_F(ListenerManagerImplTest, RuntimeDisabledInPlaceUpdateFallbacksToTraditionalUpdate) {
4851-
InSequence s;
4852-
EXPECT_CALL(*worker_, start(_));
4853-
manager_->startWorkers(guard_dog_, callback_.AsStdFunction());
4854-
4855-
// Add foo listener.
4856-
const std::string listener_foo_yaml = R"EOF(
4857-
name: foo
4858-
address:
4859-
socket_address:
4860-
address: 127.0.0.1
4861-
port_value: 1234
4862-
filter_chains:
4863-
- filters: []
4864-
)EOF";
4865-
4866-
ListenerHandle* listener_foo = expectListenerCreate(false, true);
4867-
EXPECT_CALL(listener_factory_, createListenSocket(_, _, _, {true}));
4868-
4869-
EXPECT_CALL(*worker_, addListener(_, _, _));
4870-
4871-
EXPECT_TRUE(manager_->addOrUpdateListener(parseListenerFromV3Yaml(listener_foo_yaml), "", true));
4872-
EXPECT_EQ(0, server_.stats_store_.counter("listener_manager.listener_in_place_updated").value());
4873-
4874-
worker_->callAddCompletion(true);
4875-
EXPECT_EQ(1UL, manager_->listeners().size());
4876-
checkStats(__LINE__, 1, 0, 0, 0, 1, 0, 0);
4877-
4878-
// Add foo listener again. Will execute in place filter chain update path.
4879-
const std::string listener_foo_update1_yaml = R"EOF(
4880-
name: foo
4881-
address:
4882-
socket_address:
4883-
address: 127.0.0.1
4884-
port_value: 1234
4885-
filter_chains:
4886-
- filters: []
4887-
filter_chain_match:
4888-
destination_port: 1234
4889-
)EOF";
4890-
4891-
ListenerHandle* listener_foo_update1 = expectListenerOverridden(false, listener_foo);
4892-
EXPECT_CALL(*worker_, addListener(_, _, _));
4893-
auto* timer = new Event::MockTimer(dynamic_cast<Event::MockDispatcher*>(&server_.dispatcher()));
4894-
EXPECT_CALL(*timer, enableTimer(_, _));
4895-
EXPECT_TRUE(
4896-
manager_->addOrUpdateListener(parseListenerFromV3Yaml(listener_foo_update1_yaml), "", true));
4897-
EXPECT_EQ(1, server_.stats_store_.counter("listener_manager.listener_in_place_updated").value());
4898-
4899-
EXPECT_EQ(1UL, manager_->listeners().size());
4900-
worker_->callAddCompletion(true);
4901-
4902-
EXPECT_CALL(*worker_, removeFilterChains(_, _, _));
4903-
timer->invokeCallback();
4904-
EXPECT_CALL(*listener_foo, onDestroy());
4905-
worker_->callDrainFilterChainsComplete();
4906-
4907-
// Update foo again. This time we disable in place filter chain update in runtime.
4908-
// The traditional full listener update path is used.
4909-
auto in_place_update_disabled_guard = disableInplaceUpdateForThisTest();
4910-
const std::string listener_foo_update2_yaml = R"EOF(
4911-
name: foo
4912-
address:
4913-
socket_address:
4914-
address: 127.0.0.1
4915-
port_value: 1234
4916-
filter_chains:
4917-
- filters:
4918-
filter_chain_match:
4919-
destination_port: 2345
4920-
)EOF";
4921-
4922-
ListenerHandle* listener_foo_update2 = expectListenerCreate(false, true);
4923-
EXPECT_CALL(*worker_, addListener(_, _, _));
4924-
EXPECT_CALL(*worker_, stopListener(_, _));
4925-
EXPECT_CALL(*listener_foo_update1->drain_manager_, startDrainSequence(_));
4926-
EXPECT_TRUE(
4927-
manager_->addOrUpdateListener(parseListenerFromV3Yaml(listener_foo_update2_yaml), "", true));
4928-
EXPECT_EQ(1, server_.stats_store_.counter("listener_manager.listener_in_place_updated").value());
4929-
4930-
EXPECT_CALL(*worker_, removeListener(_, _));
4931-
listener_foo_update1->drain_manager_->drain_sequence_completion_();
4932-
4933-
EXPECT_CALL(*listener_foo_update1, onDestroy());
4934-
worker_->callRemovalCompletion();
4935-
4936-
EXPECT_CALL(*worker_, stopListener(_, _));
4937-
EXPECT_CALL(*listener_factory_.socket_, close());
4938-
EXPECT_CALL(*listener_foo_update2->drain_manager_, startDrainSequence(_));
4939-
EXPECT_TRUE(manager_->removeListener("foo"));
4940-
4941-
EXPECT_CALL(*worker_, removeListener(_, _));
4942-
listener_foo_update2->drain_manager_->drain_sequence_completion_();
4943-
4944-
EXPECT_CALL(*listener_foo_update2, onDestroy());
4945-
worker_->callRemovalCompletion();
4946-
EXPECT_EQ(0UL, manager_->listeners().size());
4947-
}
4948-
49494848
// This test verifies that on default initialization the UDP Packet Writer
49504849
// is initialized in passthrough mode. (i.e. by using UdpDefaultWriter).
49514850
TEST_F(ListenerManagerImplTest, UdpDefaultWriterConfig) {

test/server/listener_manager_impl_test.h

-8
Original file line numberDiff line numberDiff line change
@@ -271,14 +271,6 @@ class ListenerManagerImplTest : public testing::Test {
271271
EXPECT_EQ(expected_listeners_config_dump.DebugString(), listeners_config_dump.DebugString());
272272
}
273273

274-
ABSL_MUST_USE_RESULT
275-
auto disableInplaceUpdateForThisTest() {
276-
auto scoped_runtime = std::make_unique<TestScopedRuntime>();
277-
Runtime::LoaderSingleton::getExisting()->mergeValues(
278-
{{"envoy.reloadable_features.listener_in_place_filterchain_update", "false"}});
279-
return scoped_runtime;
280-
}
281-
282274
ABSL_MUST_USE_RESULT
283275
auto enableTlsInspectorInjectionForThisTest() {
284276
auto scoped_runtime = std::make_unique<TestScopedRuntime>();

0 commit comments

Comments
 (0)