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 84f57a535903..3aaa47ac2c34 100644 --- a/source/extensions/filters/http/dynamic_forward_proxy/proxy_filter.cc +++ b/source/extensions/filters/http/dynamic_forward_proxy/proxy_filter.cc @@ -132,17 +132,15 @@ Http::FilterHeadersStatus ProxyFilter::decodeHeaders(Http::RequestHeaderMap& hea } switch (result.status_) { - case LoadDnsCacheEntryStatus::InCache: { + case LoadDnsCacheEntryStatus::InCache: ASSERT(cache_load_handle_ == nullptr); ENVOY_STREAM_LOG(debug, "DNS cache entry already loaded, continuing", *decoder_callbacks_); return Http::FilterHeadersStatus::Continue; - } - case LoadDnsCacheEntryStatus::Loading: { + case LoadDnsCacheEntryStatus::Loading: ASSERT(cache_load_handle_ != nullptr); ENVOY_STREAM_LOG(debug, "waiting to load DNS cache entry", *decoder_callbacks_); return Http::FilterHeadersStatus::StopAllIterationAndWatermark; - } - case LoadDnsCacheEntryStatus::Overflow: { + case LoadDnsCacheEntryStatus::Overflow: ASSERT(cache_load_handle_ == nullptr); ENVOY_STREAM_LOG(debug, "DNS cache overflow", *decoder_callbacks_); decoder_callbacks_->sendLocalReply(Http::Code::ServiceUnavailable, @@ -150,8 +148,6 @@ Http::FilterHeadersStatus ProxyFilter::decodeHeaders(Http::RequestHeaderMap& hea absl::nullopt, ResponseStrings::get().DnsCacheOverflow); return Http::FilterHeadersStatus::StopIteration; } - } - NOT_REACHED_GCOVR_EXCL_LINE; } diff --git a/test/extensions/common/dynamic_forward_proxy/dns_cache_resource_manager_test.cc b/test/extensions/common/dynamic_forward_proxy/dns_cache_resource_manager_test.cc index 04127f486fff..5ed57a7b4606 100644 --- a/test/extensions/common/dynamic_forward_proxy/dns_cache_resource_manager_test.cc +++ b/test/extensions/common/dynamic_forward_proxy/dns_cache_resource_manager_test.cc @@ -68,10 +68,13 @@ TEST_F(DnsCacheResourceManagerTest, CheckDnsResource) { EXPECT_EQ(2, pending_requests.count()); EXPECT_TRUE(pending_requests.canCreate()); + EXPECT_EQ(0, resource_manager_->stats().rq_pending_open_.value()); + EXPECT_EQ(0, resource_manager_->stats().rq_pending_remaining_.value()); + cleanup(); } } // namespace } // namespace DynamicForwardProxy } // namespace Common } // namespace Extensions -} // namespace Envoy \ No newline at end of file +} // namespace Envoy diff --git a/test/per_file_coverage.sh b/test/per_file_coverage.sh index 174c0cd14991..32f71e40fadf 100755 --- a/test/per_file_coverage.sh +++ b/test/per_file_coverage.sh @@ -35,7 +35,6 @@ declare -a KNOWN_LOW_COVERAGE=( "source/extensions/filters/common/rbac:87.5" "source/extensions/filters/http/cache:92.4" "source/extensions/filters/http/cache/simple_http_cache:95.2" -"source/extensions/filters/http/dynamic_forward_proxy:95.0" "source/extensions/filters/http/grpc_json_transcoder:94.8" "source/extensions/filters/http/ip_tagging:91.2" "source/extensions/filters/http/kill_request:95.0" # Death tests don't report LCOV