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
1 change: 1 addition & 0 deletions docs/root/version_history/current.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Removed Config or Runtime
*Normally occurs at the end of the* :ref:`deprecation period <deprecated>`

* compression: removed ``envoy.reloadable_features.enable_compression_without_content_length_header`` runtime guard and legacy code paths.
* health check: removed ``envoy.reloadable_features.health_check.immediate_failure_exclude_from_cluster`` runtime guard and legacy code paths.
* http: removed ``envoy.reloadable_features.add_and_validate_scheme_header`` and legacy code paths.
* http: removed ``envoy.reloadable_features.dont_add_content_length_for_bodiless_requests deprecation`` and legacy code paths.
* http: removed ``envoy.reloadable_features.improved_stream_limit_handling`` 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 @@ -67,7 +67,6 @@ constexpr const char* runtime_features[] = {
"envoy.reloadable_features.grpc_json_transcoder_adhere_to_buffer_limits",
"envoy.reloadable_features.hash_multiple_header_values",
"envoy.reloadable_features.health_check.graceful_goaway_handling",
"envoy.reloadable_features.health_check.immediate_failure_exclude_from_cluster",
"envoy.reloadable_features.http2_consume_stream_refused_errors",
"envoy.reloadable_features.http2_skip_encoding_empty_trailers",
"envoy.reloadable_features.http_ext_authz_do_not_skip_direct_response_and_redirect",
Expand Down
4 changes: 1 addition & 3 deletions source/common/upstream/upstream_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1087,9 +1087,7 @@ namespace {

bool excludeBasedOnHealthFlag(const Host& host) {
return host.healthFlagGet(Host::HealthFlag::PENDING_ACTIVE_HC) ||
(host.healthFlagGet(Host::HealthFlag::EXCLUDED_VIA_IMMEDIATE_HC_FAIL) &&
Runtime::runtimeFeatureEnabled(
"envoy.reloadable_features.health_check.immediate_failure_exclude_from_cluster"));
host.healthFlagGet(Host::HealthFlag::EXCLUDED_VIA_IMMEDIATE_HC_FAIL);
}

} // namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ Http::FilterHeadersStatus HealthCheckFilter::encodeHeaders(Http::ResponseHeaderM
headers.setEnvoyUpstreamHealthCheckedCluster(context_.localInfo().clusterName());
}

if (context_.healthCheckFailed() &&
Runtime::runtimeFeatureEnabled(
"envoy.reloadable_features.health_check.immediate_failure_exclude_from_cluster")) {
if (context_.healthCheckFailed()) {
headers.setReferenceEnvoyImmediateHealthCheckFail(
Http::Headers::get().EnvoyImmediateHealthCheckFailValues.True);
}
Expand Down
52 changes: 0 additions & 52 deletions test/common/upstream/upstream_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3969,58 +3969,6 @@ TEST(HostPartitionTest, PartitionHosts) {
EXPECT_EQ(hosts[4], update_hosts_params.excluded_hosts_per_locality->get()[1][1]);
}

// Verifies that partitionHosts correctly splits hosts based on their health flags when
// "envoy.reloadable_features.health_check.immediate_failure_exclude_from_cluster" is disabled.
TEST(HostPartitionTest, PartitionHostsImmediateFailureExcludeDisabled) {
TestScopedRuntime scoped_runtime;
Runtime::LoaderSingleton::getExisting()->mergeValues(
{{"envoy.reloadable_features.health_check.immediate_failure_exclude_from_cluster", "false"}});

std::shared_ptr<MockClusterInfo> info{new NiceMock<MockClusterInfo>()};
auto time_source = std::make_unique<NiceMock<MockTimeSystem>>();
HostVector hosts{makeTestHost(info, "tcp://127.0.0.1:80", *time_source),
makeTestHost(info, "tcp://127.0.0.1:81", *time_source),
makeTestHost(info, "tcp://127.0.0.1:82", *time_source),
makeTestHost(info, "tcp://127.0.0.1:83", *time_source),
makeTestHost(info, "tcp://127.0.0.1:84", *time_source)};

hosts[0]->healthFlagSet(Host::HealthFlag::FAILED_ACTIVE_HC);
hosts[1]->healthFlagSet(Host::HealthFlag::DEGRADED_ACTIVE_HC);
hosts[2]->healthFlagSet(Host::HealthFlag::PENDING_ACTIVE_HC);
hosts[2]->healthFlagSet(Host::HealthFlag::FAILED_ACTIVE_HC);
hosts[4]->healthFlagSet(Host::HealthFlag::EXCLUDED_VIA_IMMEDIATE_HC_FAIL);
hosts[4]->healthFlagSet(Host::HealthFlag::FAILED_ACTIVE_HC);

auto hosts_per_locality =
makeHostsPerLocality({{hosts[0], hosts[1]}, {hosts[2], hosts[3], hosts[4]}});

auto update_hosts_params =
HostSetImpl::partitionHosts(std::make_shared<const HostVector>(hosts), hosts_per_locality);

EXPECT_EQ(5, update_hosts_params.hosts->size());
EXPECT_EQ(1, update_hosts_params.healthy_hosts->get().size());
EXPECT_EQ(hosts[3], update_hosts_params.healthy_hosts->get()[0]);
EXPECT_EQ(1, update_hosts_params.degraded_hosts->get().size());
EXPECT_EQ(hosts[1], update_hosts_params.degraded_hosts->get()[0]);
EXPECT_EQ(1, update_hosts_params.excluded_hosts->get().size());
EXPECT_EQ(hosts[2], update_hosts_params.excluded_hosts->get()[0]);

EXPECT_EQ(2, update_hosts_params.hosts_per_locality->get()[0].size());
EXPECT_EQ(3, update_hosts_params.hosts_per_locality->get()[1].size());

EXPECT_EQ(0, update_hosts_params.healthy_hosts_per_locality->get()[0].size());
EXPECT_EQ(1, update_hosts_params.healthy_hosts_per_locality->get()[1].size());
EXPECT_EQ(hosts[3], update_hosts_params.healthy_hosts_per_locality->get()[1][0]);

EXPECT_EQ(1, update_hosts_params.degraded_hosts_per_locality->get()[0].size());
EXPECT_EQ(0, update_hosts_params.degraded_hosts_per_locality->get()[1].size());
EXPECT_EQ(hosts[1], update_hosts_params.degraded_hosts_per_locality->get()[0][0]);

EXPECT_EQ(0, update_hosts_params.excluded_hosts_per_locality->get()[0].size());
EXPECT_EQ(1, update_hosts_params.excluded_hosts_per_locality->get()[1].size());
EXPECT_EQ(hosts[2], update_hosts_params.excluded_hosts_per_locality->get()[1][0]);
}

TEST_F(ClusterInfoImplTest, MaxRequestsPerConnectionValidation) {
const std::string yaml = R"EOF(
name: cluster1
Expand Down
31 changes: 0 additions & 31 deletions test/extensions/filters/http/health_check/health_check_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,37 +252,6 @@ TEST_F(HealthCheckFilterNoPassThroughTest, HealthCheckFailedCallbackCalled) {
EXPECT_EQ(Http::FilterTrailersStatus::StopIteration, filter_->decodeTrailers(request_trailers));
}

// Verifies that header is not sent on HC requests when
// "envoy.reloadable_features.health_check.immediate_failure_exclude_from_cluster" is disabled.
TEST_F(HealthCheckFilterNoPassThroughTest,
HealthCheckFailedCallbackCalledImmediateFailureExcludeDisabled) {
TestScopedRuntime scoped_runtime;
Runtime::LoaderSingleton::getExisting()->mergeValues(
{{"envoy.reloadable_features.health_check.immediate_failure_exclude_from_cluster", "false"}});

EXPECT_CALL(context_, healthCheckFailed()).Times(2).WillRepeatedly(Return(true));
EXPECT_CALL(callbacks_.stream_info_, healthCheck(true));
EXPECT_CALL(callbacks_.active_span_, setSampled(false));
Http::TestResponseHeaderMapImpl health_check_response{{":status", "503"}};
EXPECT_CALL(callbacks_, encodeHeaders_(HeaderMapEqualRef(&health_check_response), true))
.Times(1)
.WillRepeatedly(Invoke([&](Http::ResponseHeaderMap& headers, bool end_stream) {
filter_->encodeHeaders(headers, end_stream);
EXPECT_EQ("cluster_name", headers.getEnvoyUpstreamHealthCheckedClusterValue());
EXPECT_EQ(nullptr, headers.EnvoyImmediateHealthCheckFail());
}));

EXPECT_CALL(callbacks_.stream_info_,
setResponseFlag(StreamInfo::ResponseFlag::FailedLocalHealthCheck));

EXPECT_EQ(Http::FilterHeadersStatus::StopIteration,
filter_->decodeHeaders(request_headers_, false));
Buffer::OwnedImpl data("hello");
EXPECT_EQ(Http::FilterDataStatus::StopIterationNoBuffer, filter_->decodeData(data, false));
Http::TestRequestTrailerMapImpl request_trailers;
EXPECT_EQ(Http::FilterTrailersStatus::StopIteration, filter_->decodeTrailers(request_trailers));
}

TEST_F(HealthCheckFilterPassThroughTest, Ok) {
EXPECT_CALL(context_, healthCheckFailed()).Times(2).WillRepeatedly(Return(false));
EXPECT_CALL(callbacks_.stream_info_, healthCheck(true));
Expand Down