diff --git a/api/envoy/extensions/common/dynamic_forward_proxy/v3/dns_cache.proto b/api/envoy/extensions/common/dynamic_forward_proxy/v3/dns_cache.proto index 5579cc16bd97d..4b182a29711bd 100644 --- a/api/envoy/extensions/common/dynamic_forward_proxy/v3/dns_cache.proto +++ b/api/envoy/extensions/common/dynamic_forward_proxy/v3/dns_cache.proto @@ -92,8 +92,7 @@ message DnsCacheConfig { config.cluster.v3.Cluster.RefreshRate dns_failure_refresh_rate = 6; // The config of circuit breakers for resolver. It provides a configurable threshold. - // If `envoy.reloadable_features.enable_dns_cache_circuit_breakers` is enabled, - // envoy will use dns cache circuit breakers with default settings even if this value is not set. + // Envoy will use dns cache circuit breakers with default settings even if this value is not set. DnsCacheCircuitBreakers dns_cache_circuit_breaker = 7; // [#next-major-version: Reconcile DNS options in a single message.] diff --git a/docs/root/configuration/http/http_filters/dynamic_forward_proxy_filter.rst b/docs/root/configuration/http/http_filters/dynamic_forward_proxy_filter.rst index 4e1ca35263413..3699fb96d3efc 100644 --- a/docs/root/configuration/http/http_filters/dynamic_forward_proxy_filter.rst +++ b/docs/root/configuration/http/http_filters/dynamic_forward_proxy_filter.rst @@ -31,8 +31,6 @@ host when forwarding. See the example below within the configured routes. .. _dns_cache_circuit_breakers: Dynamic forward proxy uses circuit breakers built in to the DNS cache with the configuration - of :ref:`DNS cache circuit breakers `. By default, this behavior is enabled by the runtime feature `envoy.reloadable_features.enable_dns_cache_circuit_breakers`. - If this runtime feature is disabled, cluster circuit breakers will be used even when setting the configuration of :ref:`DNS cache circuit breakers `. .. literalinclude:: _include/dns-cache-circuit-breaker.yaml diff --git a/docs/root/version_history/current.rst b/docs/root/version_history/current.rst index 09319d899d7c6..ea77e4f302aef 100644 --- a/docs/root/version_history/current.rst +++ b/docs/root/version_history/current.rst @@ -30,6 +30,7 @@ Removed Config or Runtime *Normally occurs at the end of the* :ref:`deprecation period ` * access_logs: removed legacy unbounded access logs and runtime guard `envoy.reloadable_features.disallow_unbounded_access_logs`. +* dynamic_forward_proxy: removed `envoy.reloadable_features.enable_dns_cache_circuit_breakers` and legacy code path. * http: removed legacy HTTP/1.1 error reporting path and runtime guard `envoy.reloadable_features.early_errors_via_hcm`. New Features diff --git a/generated_api_shadow/envoy/extensions/common/dynamic_forward_proxy/v3/dns_cache.proto b/generated_api_shadow/envoy/extensions/common/dynamic_forward_proxy/v3/dns_cache.proto index 5579cc16bd97d..4b182a29711bd 100644 --- a/generated_api_shadow/envoy/extensions/common/dynamic_forward_proxy/v3/dns_cache.proto +++ b/generated_api_shadow/envoy/extensions/common/dynamic_forward_proxy/v3/dns_cache.proto @@ -92,8 +92,7 @@ message DnsCacheConfig { config.cluster.v3.Cluster.RefreshRate dns_failure_refresh_rate = 6; // The config of circuit breakers for resolver. It provides a configurable threshold. - // If `envoy.reloadable_features.enable_dns_cache_circuit_breakers` is enabled, - // envoy will use dns cache circuit breakers with default settings even if this value is not set. + // Envoy will use dns cache circuit breakers with default settings even if this value is not set. DnsCacheCircuitBreakers dns_cache_circuit_breaker = 7; // [#next-major-version: Reconcile DNS options in a single message.] diff --git a/source/common/runtime/runtime_features.cc b/source/common/runtime/runtime_features.cc index 73f96216c09c8..8fb0a8c53b5b1 100644 --- a/source/common/runtime/runtime_features.cc +++ b/source/common/runtime/runtime_features.cc @@ -65,7 +65,6 @@ constexpr const char* runtime_features[] = { "envoy.reloadable_features.consume_all_retry_headers", "envoy.reloadable_features.check_ocsp_policy", "envoy.reloadable_features.disable_tls_inspector_injection", - "envoy.reloadable_features.enable_dns_cache_circuit_breakers", "envoy.reloadable_features.fix_upgrade_response", "envoy.reloadable_features.fix_wildcard_matching", "envoy.reloadable_features.fixed_connection_close", diff --git a/source/extensions/common/dynamic_forward_proxy/dns_cache.h b/source/extensions/common/dynamic_forward_proxy/dns_cache.h index 7425639531db0..20cf354a3a190 100644 --- a/source/extensions/common/dynamic_forward_proxy/dns_cache.h +++ b/source/extensions/common/dynamic_forward_proxy/dns_cache.h @@ -191,12 +191,9 @@ class DnsCache { /** * Check if a DNS request is allowed given resource limits. - * @param pending_request optional pending request resource limit. If no resource limit is - * provided the internal DNS cache limit is used. * @return RAII handle for pending request circuit breaker if the request was allowed. */ - virtual Upstream::ResourceAutoIncDecPtr - canCreateDnsRequest(ResourceLimitOptRef pending_request) PURE; + virtual Upstream::ResourceAutoIncDecPtr canCreateDnsRequest() PURE; }; using DnsCacheSharedPtr = std::shared_ptr; diff --git a/source/extensions/common/dynamic_forward_proxy/dns_cache_impl.cc b/source/extensions/common/dynamic_forward_proxy/dns_cache_impl.cc index 094255c84924b..4be9cf22786d5 100644 --- a/source/extensions/common/dynamic_forward_proxy/dns_cache_impl.cc +++ b/source/extensions/common/dynamic_forward_proxy/dns_cache_impl.cc @@ -83,15 +83,10 @@ DnsCacheImpl::loadDnsCacheEntry(absl::string_view host, uint16_t default_port, } } -Upstream::ResourceAutoIncDecPtr -DnsCacheImpl::canCreateDnsRequest(ResourceLimitOptRef pending_requests) { - const auto has_pending_requests = pending_requests.has_value(); - auto& current_pending_requests = - has_pending_requests ? pending_requests->get() : resource_manager_.pendingRequests(); +Upstream::ResourceAutoIncDecPtr DnsCacheImpl::canCreateDnsRequest() { + auto& current_pending_requests = resource_manager_.pendingRequests(); if (!current_pending_requests.canCreate()) { - if (!has_pending_requests) { - stats_.dns_rq_pending_overflow_.inc(); - } + stats_.dns_rq_pending_overflow_.inc(); return nullptr; } return std::make_unique(current_pending_requests); diff --git a/source/extensions/common/dynamic_forward_proxy/dns_cache_impl.h b/source/extensions/common/dynamic_forward_proxy/dns_cache_impl.h index d918ddcb7a7aa..2dcee3d0483c0 100644 --- a/source/extensions/common/dynamic_forward_proxy/dns_cache_impl.h +++ b/source/extensions/common/dynamic_forward_proxy/dns_cache_impl.h @@ -53,8 +53,7 @@ class DnsCacheImpl : public DnsCache, Logger::Loggable getHost(absl::string_view host_name) override; - Upstream::ResourceAutoIncDecPtr - canCreateDnsRequest(ResourceLimitOptRef pending_requests) override; + Upstream::ResourceAutoIncDecPtr canCreateDnsRequest() override; private: struct LoadDnsCacheEntryHandleImpl diff --git a/source/extensions/filters/http/dynamic_forward_proxy/BUILD b/source/extensions/filters/http/dynamic_forward_proxy/BUILD index dc15f124ed780..528a263694945 100644 --- a/source/extensions/filters/http/dynamic_forward_proxy/BUILD +++ b/source/extensions/filters/http/dynamic_forward_proxy/BUILD @@ -15,7 +15,6 @@ envoy_cc_library( hdrs = ["proxy_filter.h"], deps = [ "//include/envoy/http:filter_interface", - "//source/common/runtime:runtime_features_lib", "//source/extensions/clusters:well_known_names", "//source/extensions/common/dynamic_forward_proxy:dns_cache_interface", "//source/extensions/filters/http:well_known_names", diff --git a/source/extensions/filters/http/dynamic_forward_proxy/proxy_filter.cc b/source/extensions/filters/http/dynamic_forward_proxy/proxy_filter.cc index 3aaa47ac2c34f..3c76af250c34e 100644 --- a/source/extensions/filters/http/dynamic_forward_proxy/proxy_filter.cc +++ b/source/extensions/filters/http/dynamic_forward_proxy/proxy_filter.cc @@ -4,8 +4,6 @@ #include "envoy/config/core/v3/base.pb.h" #include "envoy/extensions/filters/http/dynamic_forward_proxy/v3/dynamic_forward_proxy.pb.h" -#include "common/runtime/runtime_features.h" - #include "extensions/clusters/well_known_names.h" #include "extensions/common/dynamic_forward_proxy/dns_cache.h" #include "extensions/filters/http/well_known_names.h" @@ -71,19 +69,9 @@ Http::FilterHeadersStatus ProxyFilter::decodeHeaders(Http::RequestHeaderMap& hea return Http::FilterHeadersStatus::Continue; } - const bool should_use_dns_cache_circuit_breakers = - Runtime::runtimeFeatureEnabled("envoy.reloadable_features.enable_dns_cache_circuit_breakers"); - - circuit_breaker_ = config_->cache().canCreateDnsRequest( - !should_use_dns_cache_circuit_breakers - ? absl::make_optional(std::reference_wrapper( - cluster_info_->resourceManager(route_entry->priority()).pendingRequests())) - : absl::nullopt); + circuit_breaker_ = config_->cache().canCreateDnsRequest(); if (circuit_breaker_ == nullptr) { - if (!should_use_dns_cache_circuit_breakers) { - cluster_info_->stats().upstream_rq_pending_overflow_.inc(); - } ENVOY_STREAM_LOG(debug, "pending request overflow", *this->decoder_callbacks_); this->decoder_callbacks_->sendLocalReply( Http::Code::ServiceUnavailable, ResponseStrings::get().PendingRequestOverflow, nullptr, diff --git a/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc b/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc index 9b3584de72c48..0e1136336c005 100644 --- a/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc +++ b/source/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter.cc @@ -33,7 +33,7 @@ Network::FilterStatus ProxyFilter::onNewConnection() { return Network::FilterStatus::Continue; } - circuit_breaker_ = config_->cache().canCreateDnsRequest(absl::nullopt); + circuit_breaker_ = config_->cache().canCreateDnsRequest(); if (circuit_breaker_ == nullptr) { ENVOY_CONN_LOG(debug, "pending request overflow", read_callbacks_->connection()); diff --git a/test/extensions/common/dynamic_forward_proxy/dns_cache_impl_test.cc b/test/extensions/common/dynamic_forward_proxy/dns_cache_impl_test.cc index 9afbe86d88957..5eb41286c467c 100644 --- a/test/extensions/common/dynamic_forward_proxy/dns_cache_impl_test.cc +++ b/test/extensions/common/dynamic_forward_proxy/dns_cache_impl_test.cc @@ -662,7 +662,7 @@ TEST_F(DnsCacheImplTest, MaxHostOverflow) { TEST_F(DnsCacheImplTest, CircuitBreakersNotInvoked) { initialize(); - auto raii_ptr = dns_cache_->canCreateDnsRequest(absl::nullopt); + auto raii_ptr = dns_cache_->canCreateDnsRequest(); EXPECT_NE(raii_ptr.get(), nullptr); } @@ -670,21 +670,11 @@ TEST_F(DnsCacheImplTest, DnsCacheCircuitBreakersOverflow) { config_.mutable_dns_cache_circuit_breaker()->mutable_max_pending_requests()->set_value(0); initialize(); - auto raii_ptr = dns_cache_->canCreateDnsRequest(absl::nullopt); + auto raii_ptr = dns_cache_->canCreateDnsRequest(); EXPECT_EQ(raii_ptr.get(), nullptr); EXPECT_EQ(1, TestUtility::findCounter(store_, "dns_cache.foo.dns_rq_pending_overflow")->value()); } -TEST_F(DnsCacheImplTest, ClustersCircuitBreakersOverflow) { - initialize(); - NiceMock pending_requests_; - - EXPECT_CALL(pending_requests_, canCreate()).WillOnce(Return(false)); - auto raii_ptr = dns_cache_->canCreateDnsRequest(pending_requests_); - EXPECT_EQ(raii_ptr.get(), nullptr); - EXPECT_EQ(0, TestUtility::findCounter(store_, "dns_cache.foo.dns_rq_pending_overflow")->value()); -} - TEST(DnsCacheImplOptionsTest, UseTcpForDnsLookupsOptionSet) { NiceMock dispatcher; std::shared_ptr resolver{std::make_shared()}; diff --git a/test/extensions/common/dynamic_forward_proxy/mocks.cc b/test/extensions/common/dynamic_forward_proxy/mocks.cc index ef27a4de5b00a..6b99e00bf460b 100644 --- a/test/extensions/common/dynamic_forward_proxy/mocks.cc +++ b/test/extensions/common/dynamic_forward_proxy/mocks.cc @@ -16,7 +16,7 @@ MockDnsCacheResourceManager::MockDnsCacheResourceManager() { MockDnsCacheResourceManager::~MockDnsCacheResourceManager() = default; MockDnsCache::MockDnsCache() { - ON_CALL(*this, canCreateDnsRequest_(_)).WillByDefault(Return(nullptr)); + ON_CALL(*this, canCreateDnsRequest_()).WillByDefault(Return(nullptr)); } MockDnsCache::~MockDnsCache() = default; diff --git a/test/extensions/common/dynamic_forward_proxy/mocks.h b/test/extensions/common/dynamic_forward_proxy/mocks.h index aee7140a0aedd..e8f7f87e993de 100644 --- a/test/extensions/common/dynamic_forward_proxy/mocks.h +++ b/test/extensions/common/dynamic_forward_proxy/mocks.h @@ -41,9 +41,8 @@ class MockDnsCache : public DnsCache { MockLoadDnsCacheEntryResult result = loadDnsCacheEntry_(host, default_port, callbacks); return {result.status_, LoadDnsCacheEntryHandlePtr{result.handle_}}; } - Upstream::ResourceAutoIncDecPtr - canCreateDnsRequest(ResourceLimitOptRef pending_requests) override { - Upstream::ResourceAutoIncDec* raii_ptr = canCreateDnsRequest_(pending_requests); + Upstream::ResourceAutoIncDecPtr canCreateDnsRequest() override { + Upstream::ResourceAutoIncDec* raii_ptr = canCreateDnsRequest_(); return std::unique_ptr(raii_ptr); } MOCK_METHOD(MockLoadDnsCacheEntryResult, loadDnsCacheEntry_, @@ -58,7 +57,7 @@ class MockDnsCache : public DnsCache { MOCK_METHOD((void), iterateHostMap, (IterateHostMapCb)); MOCK_METHOD((absl::optional), getHost, (absl::string_view)); - MOCK_METHOD(Upstream::ResourceAutoIncDec*, canCreateDnsRequest_, (ResourceLimitOptRef)); + MOCK_METHOD(Upstream::ResourceAutoIncDec*, canCreateDnsRequest_, ()); }; class MockLoadDnsCacheEntryHandle : public DnsCache::LoadDnsCacheEntryHandle { diff --git a/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_integration_test.cc b/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_integration_test.cc index 1332c9c11a605..7181173eb6371 100644 --- a/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_integration_test.cc +++ b/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_integration_test.cc @@ -102,11 +102,6 @@ name: envoy.clusters.dynamic_forward_proxy } } - void disableDnsCacheCircuitBreakers() { - config_helper_.addRuntimeOverride("envoy.reloadable_features.enable_dns_cache_circuit_breakers", - "false"); - } - bool upstream_tls_{}; std::string upstream_cert_name_{"upstreamlocalhost"}; CdsHelper cds_helper_; @@ -142,30 +137,6 @@ TEST_P(ProxyFilterIntegrationTest, RequestWithBody) { EXPECT_EQ(1, test_server_->counter("dns_cache.foo.host_added")->value()); } -TEST_P(ProxyFilterIntegrationTest, RequestWithBodyWithClusterCircuitBreaker) { - disableDnsCacheCircuitBreakers(); - setup(); - codec_client_ = makeHttpConnection(lookupPort("http")); - const Http::TestRequestHeaderMapImpl request_headers{ - {":method", "POST"}, - {":path", "/test/long/url"}, - {":scheme", "http"}, - {":authority", - fmt::format("localhost:{}", fake_upstreams_[0]->localAddress()->ip()->port())}}; - - auto response = - sendRequestAndWaitForResponse(request_headers, 1024, default_response_headers_, 1024); - checkSimpleRequestSuccess(1024, 1024, response.get()); - EXPECT_EQ(1, test_server_->counter("dns_cache.foo.dns_query_attempt")->value()); - EXPECT_EQ(1, test_server_->counter("dns_cache.foo.host_added")->value()); - - // Now send another request. This should hit the DNS cache. - response = sendRequestAndWaitForResponse(request_headers, 512, default_response_headers_, 512); - checkSimpleRequestSuccess(512, 512, response.get()); - EXPECT_EQ(1, test_server_->counter("dns_cache.foo.dns_query_attempt")->value()); - EXPECT_EQ(1, test_server_->counter("dns_cache.foo.host_added")->value()); -} - // Verify that after we populate the cache and reload the cluster we reattach to the cache with // its existing hosts. TEST_P(ProxyFilterIntegrationTest, ReloadClusterAndAttachToCache) { @@ -346,25 +317,5 @@ TEST_P(ProxyFilterIntegrationTest, DnsCacheCircuitBreakersInvoked) { EXPECT_EQ("503", response->headers().Status()->value().getStringView()); } -TEST_P(ProxyFilterIntegrationTest, ClusterCircuitBreakersInvoked) { - disableDnsCacheCircuitBreakers(); - setup(1024, 0); - - codec_client_ = makeHttpConnection(lookupPort("http")); - const Http::TestRequestHeaderMapImpl request_headers{ - {":method", "POST"}, - {":path", "/test/long/url"}, - {":scheme", "http"}, - {":authority", - fmt::format("localhost:{}", fake_upstreams_[0]->localAddress()->ip()->port())}}; - - auto response = codec_client_->makeRequestWithBody(request_headers, 1024); - response->waitForEndStream(); - EXPECT_EQ(1, test_server_->counter("cluster.cluster_0.upstream_rq_pending_overflow")->value()); - - EXPECT_TRUE(response->complete()); - EXPECT_EQ("503", response->headers().Status()->value().getStringView()); -} - } // namespace } // namespace Envoy diff --git a/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_test.cc b/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_test.cc index 6af89ae829ec8..c4ee7cce19b47 100644 --- a/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_test.cc +++ b/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_test.cc @@ -90,7 +90,7 @@ TEST_F(ProxyFilterTest, HttpDefaultPort) { EXPECT_CALL(callbacks_, route()); EXPECT_CALL(cm_, getThreadLocalCluster(_)); - EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_(_)) + EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_()) .WillOnce(Return(circuit_breakers_)); EXPECT_CALL(*transport_socket_factory_, implementsSecureTransport()).WillOnce(Return(false)); Extensions::Common::DynamicForwardProxy::MockLoadDnsCacheEntryHandle* handle = @@ -112,7 +112,7 @@ TEST_F(ProxyFilterTest, HttpsDefaultPort) { EXPECT_CALL(callbacks_, route()); EXPECT_CALL(cm_, getThreadLocalCluster(_)); - EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_(_)) + EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_()) .WillOnce(Return(circuit_breakers_)); EXPECT_CALL(*transport_socket_factory_, implementsSecureTransport()).WillOnce(Return(true)); Extensions::Common::DynamicForwardProxy::MockLoadDnsCacheEntryHandle* handle = @@ -134,7 +134,7 @@ TEST_F(ProxyFilterTest, CacheOverflow) { EXPECT_CALL(callbacks_, route()); EXPECT_CALL(cm_, getThreadLocalCluster(_)); - EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_(_)) + EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_()) .WillOnce(Return(circuit_breakers_)); EXPECT_CALL(*transport_socket_factory_, implementsSecureTransport()).WillOnce(Return(true)); EXPECT_CALL(*dns_cache_manager_->dns_cache_, loadDnsCacheEntry_(Eq("foo"), 443, _)) @@ -151,17 +151,13 @@ TEST_F(ProxyFilterTest, CacheOverflow) { // Circuit breaker overflow TEST_F(ProxyFilterTest, CircuitBreakerOverflow) { - // Disable dns cache circuit breakers because which we expect to be used cluster circuit breakers. - TestScopedRuntime scoped_runtime; - Runtime::LoaderSingleton::getExisting()->mergeValues( - {{"envoy.reloadable_features.enable_dns_cache_circuit_breakers", "false"}}); Upstream::ResourceAutoIncDec* circuit_breakers_( new Upstream::ResourceAutoIncDec(pending_requests_)); InSequence s; EXPECT_CALL(callbacks_, route()); EXPECT_CALL(cm_, getThreadLocalCluster(_)); - EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_(_)) + EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_()) .WillOnce(Return(circuit_breakers_)); EXPECT_CALL(*transport_socket_factory_, implementsSecureTransport()).WillOnce(Return(true)); Extensions::Common::DynamicForwardProxy::MockLoadDnsCacheEntryHandle* handle = @@ -176,7 +172,7 @@ TEST_F(ProxyFilterTest, CircuitBreakerOverflow) { filter2->setDecoderFilterCallbacks(callbacks_); EXPECT_CALL(callbacks_, route()); EXPECT_CALL(cm_, getThreadLocalCluster(_)); - EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_(_)); + EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_()); EXPECT_CALL(callbacks_, sendLocalReply(Http::Code::ServiceUnavailable, Eq("Dynamic forward proxy pending request overflow"), _, _, Eq("Dynamic forward proxy pending request overflow"))); @@ -185,8 +181,6 @@ TEST_F(ProxyFilterTest, CircuitBreakerOverflow) { EXPECT_EQ(Http::FilterHeadersStatus::StopIteration, filter2->decodeHeaders(request_headers_, false)); - EXPECT_EQ(1, - cm_.thread_local_cluster_.cluster_.info_->stats_.upstream_rq_pending_overflow_.value()); filter2->onDestroy(); EXPECT_CALL(*handle, onDestroy()); filter_->onDestroy(); @@ -200,7 +194,7 @@ TEST_F(ProxyFilterTest, CircuitBreakerOverflowWithDnsCacheResourceManager) { EXPECT_CALL(callbacks_, route()); EXPECT_CALL(cm_, getThreadLocalCluster(_)); - EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_(_)) + EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_()) .WillOnce(Return(circuit_breakers_)); EXPECT_CALL(*transport_socket_factory_, implementsSecureTransport()).WillOnce(Return(true)); Extensions::Common::DynamicForwardProxy::MockLoadDnsCacheEntryHandle* handle = @@ -215,7 +209,7 @@ TEST_F(ProxyFilterTest, CircuitBreakerOverflowWithDnsCacheResourceManager) { filter2->setDecoderFilterCallbacks(callbacks_); EXPECT_CALL(callbacks_, route()); EXPECT_CALL(cm_, getThreadLocalCluster(_)); - EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_(_)); + EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_()); EXPECT_CALL(callbacks_, sendLocalReply(Http::Code::ServiceUnavailable, Eq("Dynamic forward proxy pending request overflow"), _, _, Eq("Dynamic forward proxy pending request overflow"))); @@ -284,7 +278,7 @@ TEST_F(ProxyFilterTest, HostRewrite) { EXPECT_CALL(callbacks_, route()); EXPECT_CALL(cm_, getThreadLocalCluster(_)); - EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_(_)) + EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_()) .WillOnce(Return(circuit_breakers_)); EXPECT_CALL(*transport_socket_factory_, implementsSecureTransport()).WillOnce(Return(false)); Extensions::Common::DynamicForwardProxy::MockLoadDnsCacheEntryHandle* handle = @@ -312,7 +306,7 @@ TEST_F(ProxyFilterTest, HostRewriteViaHeader) { EXPECT_CALL(callbacks_, route()); EXPECT_CALL(cm_, getThreadLocalCluster(_)); - EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_(_)) + EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_()) .WillOnce(Return(circuit_breakers_)); EXPECT_CALL(*transport_socket_factory_, implementsSecureTransport()).WillOnce(Return(false)); Extensions::Common::DynamicForwardProxy::MockLoadDnsCacheEntryHandle* handle = diff --git a/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_test.cc b/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_test.cc index 93f8b17cfdcc2..01073b5e6c96a 100644 --- a/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_test.cc +++ b/test/extensions/filters/network/sni_dynamic_forward_proxy/proxy_filter_test.cc @@ -73,7 +73,7 @@ TEST_F(SniDynamicProxyFilterTest, LoadDnsCache) { EXPECT_CALL(connection_, requestedServerName()).WillRepeatedly(Return("foo")); Upstream::ResourceAutoIncDec* circuit_breakers_{ new Upstream::ResourceAutoIncDec(pending_requests_)}; - EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_(_)) + EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_()) .WillOnce(Return(circuit_breakers_)); Extensions::Common::DynamicForwardProxy::MockLoadDnsCacheEntryHandle* handle = new Extensions::Common::DynamicForwardProxy::MockLoadDnsCacheEntryHandle(); @@ -91,7 +91,7 @@ TEST_F(SniDynamicProxyFilterTest, LoadDnsInCache) { EXPECT_CALL(connection_, requestedServerName()).WillRepeatedly(Return("foo")); Upstream::ResourceAutoIncDec* circuit_breakers_{ new Upstream::ResourceAutoIncDec(pending_requests_)}; - EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_(_)) + EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_()) .WillOnce(Return(circuit_breakers_)); EXPECT_CALL(*dns_cache_manager_->dns_cache_, loadDnsCacheEntry_(Eq("foo"), 443, _)) .WillOnce(Return(MockLoadDnsCacheEntryResult{LoadDnsCacheEntryStatus::InCache, nullptr})); @@ -104,7 +104,7 @@ TEST_F(SniDynamicProxyFilterTest, CacheOverflow) { EXPECT_CALL(connection_, requestedServerName()).WillRepeatedly(Return("foo")); Upstream::ResourceAutoIncDec* circuit_breakers_{ new Upstream::ResourceAutoIncDec(pending_requests_)}; - EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_(_)) + EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_()) .WillOnce(Return(circuit_breakers_)); EXPECT_CALL(*dns_cache_manager_->dns_cache_, loadDnsCacheEntry_(Eq("foo"), 443, _)) .WillOnce(Return(MockLoadDnsCacheEntryResult{LoadDnsCacheEntryStatus::Overflow, nullptr})); @@ -114,7 +114,7 @@ TEST_F(SniDynamicProxyFilterTest, CacheOverflow) { TEST_F(SniDynamicProxyFilterTest, CircuitBreakerInvoked) { EXPECT_CALL(connection_, requestedServerName()).WillRepeatedly(Return("foo")); - EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_(_)).WillOnce(Return(nullptr)); + EXPECT_CALL(*dns_cache_manager_->dns_cache_, canCreateDnsRequest_()).WillOnce(Return(nullptr)); EXPECT_CALL(connection_, close(Network::ConnectionCloseType::NoFlush)); EXPECT_EQ(Network::FilterStatus::StopIteration, filter_->onNewConnection()); }