diff --git a/docs/root/version_history/current.rst b/docs/root/version_history/current.rst index 4ce463195f937..ea8d80cd4b605 100644 --- a/docs/root/version_history/current.rst +++ b/docs/root/version_history/current.rst @@ -23,6 +23,7 @@ Removed Config or Runtime *Normally occurs at the end of the* :ref:`deprecation period ` * 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. diff --git a/source/common/runtime/runtime_features.cc b/source/common/runtime/runtime_features.cc index 6b0220d3d8e40..bb4407b57f322 100644 --- a/source/common/runtime/runtime_features.cc +++ b/source/common/runtime/runtime_features.cc @@ -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", diff --git a/source/common/upstream/upstream_impl.cc b/source/common/upstream/upstream_impl.cc index 4671f81602de3..aefbf8fb8da91 100644 --- a/source/common/upstream/upstream_impl.cc +++ b/source/common/upstream/upstream_impl.cc @@ -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 diff --git a/source/extensions/filters/http/health_check/health_check.cc b/source/extensions/filters/http/health_check/health_check.cc index 4a15e62df9f95..08b3cb8b29c70 100644 --- a/source/extensions/filters/http/health_check/health_check.cc +++ b/source/extensions/filters/http/health_check/health_check.cc @@ -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); } diff --git a/test/common/upstream/upstream_impl_test.cc b/test/common/upstream/upstream_impl_test.cc index 79efee3c96b90..d4bbc05a3382f 100644 --- a/test/common/upstream/upstream_impl_test.cc +++ b/test/common/upstream/upstream_impl_test.cc @@ -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 info{new NiceMock()}; - auto time_source = std::make_unique>(); - 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(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 diff --git a/test/extensions/filters/http/health_check/health_check_test.cc b/test/extensions/filters/http/health_check/health_check_test.cc index d2715efa89c68..2eaf8db8acb37 100644 --- a/test/extensions/filters/http/health_check/health_check_test.cc +++ b/test/extensions/filters/http/health_check/health_check_test.cc @@ -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));