Skip to content
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
3 changes: 3 additions & 0 deletions changelogs/current.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ removed_config_or_runtime:
- area: jwt_authn
change: |
Removed runtime guard ``envoy.reloadable_features.jwt_fetcher_use_scheme_from_uri`` and legacy code paths.
- area: tcp
change: |
Removed runtime guard ``envoy.reloadable_features.tcp_proxy_retry_on_different_event_loop`` and legacy code paths.
- area: http
change: |
Removed runtime guard ``envoy.reloadable_features.http1_balsa_allow_cr_or_lf_at_request_start`` and legacy code paths.
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 @@ -71,7 +71,6 @@ RUNTIME_GUARD(envoy_reloadable_features_router_filter_resetall_on_local_reply);
RUNTIME_GUARD(envoy_reloadable_features_safe_http2_options);
RUNTIME_GUARD(envoy_reloadable_features_skip_dns_lookup_for_proxied_requests);
RUNTIME_GUARD(envoy_reloadable_features_skip_ext_proc_on_local_reply);
RUNTIME_GUARD(envoy_reloadable_features_tcp_proxy_retry_on_different_event_loop);
RUNTIME_GUARD(envoy_reloadable_features_tcp_proxy_set_idle_timer_immediately_on_new_connection);
RUNTIME_GUARD(envoy_reloadable_features_test_feature_true);
RUNTIME_GUARD(envoy_reloadable_features_trace_refresh_after_route_refresh);
Expand Down
12 changes: 2 additions & 10 deletions source/common/tcp_proxy/tcp_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -618,9 +618,7 @@ Network::FilterStatus Filter::establishUpstreamConnection() {
return Network::FilterStatus::StopIteration;
}

if (!config_->backoffStrategy() &&
!Runtime::runtimeFeatureEnabled(
"envoy.reloadable_features.tcp_proxy_retry_on_different_event_loop")) {
if (!config_->backoffStrategy()) {
const uint32_t max_connect_attempts = config_->maxConnectAttempts();
if (connect_attempts_ >= max_connect_attempts) {
getStreamInfo().setResponseFlag(StreamInfo::CoreResponseFlag::UpstreamRetryLimitExceeded);
Expand Down Expand Up @@ -1093,13 +1091,7 @@ void Filter::onUpstreamEvent(Network::ConnectionEvent event) {
}
}
if (!downstream_closed_) {
if (!config_->backoffStrategy() &&
!Runtime::runtimeFeatureEnabled(
"envoy.reloadable_features.tcp_proxy_retry_on_different_event_loop")) {
onRetryTimer();
return;
}

// Always defer retry to a different event loop iteration via the retry timer.
if (connect_attempts_ >= config_->maxConnectAttempts()) {
onConnectMaxAttempts();
return;
Expand Down
79 changes: 0 additions & 79 deletions test/integration/tcp_tunneling_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2366,85 +2366,6 @@ TEST_P(
EXPECT_THAT(waitForAccessLog(access_log_filename), testing::HasSubstr(expected_log));
}

TEST_P(
TcpTunnelingIntegrationTest,
ConnectionAttemptRetryOnUpstreamConnectionCloseBeforeResponseHeadersNoBackoffOptionsRetryOnSameEventLoop) {
const std::string access_log_filename =
TestEnvironment::temporaryPath(TestUtility::uniqueFilename());
config_helper_.addRuntimeOverride(
"envoy.reloadable_features.tcp_proxy_retry_on_different_event_loop", "false");
config_helper_.addConfigModifier([&](envoy::config::bootstrap::v3::Bootstrap& bootstrap) -> void {
envoy::extensions::filters::network::tcp_proxy::v3::TcpProxy proxy_config;
proxy_config.set_stat_prefix("tcp_stats");
proxy_config.set_cluster("cluster_0");
proxy_config.mutable_tunneling_config()->set_hostname("foo.lyft.com:80");
proxy_config.mutable_max_connect_attempts()->set_value(2);

envoy::extensions::access_loggers::file::v3::FileAccessLog access_log_config;
access_log_config.mutable_log_format()->mutable_text_format_source()->set_inline_string(
"%UPSTREAM_REQUEST_ATTEMPT_COUNT% %RESPONSE_FLAGS%\n");
access_log_config.set_path(access_log_filename);
proxy_config.add_access_log()->mutable_typed_config()->PackFrom(access_log_config);

auto* listeners = bootstrap.mutable_static_resources()->mutable_listeners();
for (auto& listener : *listeners) {
if (listener.name() != "tcp_proxy") {
continue;
}
auto* filter_chain = listener.mutable_filter_chains(0);
auto* filter = filter_chain->mutable_filters(0);
filter->mutable_typed_config()->PackFrom(proxy_config);
break;
}
});
initialize();

// Start a connection, and verify the upgrade headers are received upstream.
tcp_client_ = makeTcpConnection(lookupPort("tcp_proxy"));

// Send some data straight away.
ASSERT_TRUE(tcp_client_->write("hello", false));

ASSERT_TRUE(fake_upstreams_[0]->waitForHttpConnection(*dispatcher_, fake_upstream_connection_));
ASSERT_TRUE(fake_upstream_connection_->waitForNewStream(*dispatcher_, upstream_request_));
ASSERT_TRUE(upstream_request_->waitForHeadersComplete());

// Close the upstream connection before sending response headers.
ASSERT_TRUE(fake_upstream_connection_->close());
ASSERT_TRUE(fake_upstream_connection_->waitForDisconnect());

if (upstreamProtocol() == Http::CodecType::HTTP2) {
// The connection is not fully closed yet, so the retry will be on the same connection.
tcp_client_->close();
const std::string expected_log =
"2 " + std::string(StreamInfo::ResponseFlagUtils::UPSTREAM_CONNECTION_FAILURE) + "," +
std::string(StreamInfo::ResponseFlagUtils::UPSTREAM_RETRY_LIMIT_EXCEEDED);
EXPECT_THAT(waitForAccessLog(access_log_filename), testing::HasSubstr(expected_log));
return;
}

// Retry to create a new stream on new connection and not the closed one.
ASSERT_TRUE(fake_upstreams_[0]->waitForHttpConnection(*dispatcher_, fake_upstream_connection_));
ASSERT_TRUE(fake_upstream_connection_->waitForNewStream(*dispatcher_, upstream_request_));
ASSERT_TRUE(upstream_request_->waitForHeadersComplete());

upstream_request_->encodeHeaders(default_response_headers_, false);
ASSERT_TRUE(upstream_request_->waitForData(*dispatcher_, 5));

tcp_client_->close();
if (upstreamProtocol() == Http::CodecType::HTTP1) {
ASSERT_TRUE(fake_upstream_connection_->waitForDisconnect());
} else {
ASSERT_TRUE(upstream_request_->waitForEndStream(*dispatcher_));
// If the upstream now sends 'end stream' the connection is fully closed.
upstream_request_->encodeData(0, true);
}

const std::string expected_log =
"2 " + std::string(StreamInfo::ResponseFlagUtils::UPSTREAM_CONNECTION_FAILURE);
EXPECT_THAT(waitForAccessLog(access_log_filename), testing::HasSubstr(expected_log));
}

TEST_P(TcpTunnelingIntegrationTest,
ConnectionAttemptRetryOnUpstreamConnectionCloseBeforeResponseHeadersWithBackoffOptions) {
const std::string access_log_filename =
Expand Down
Loading