Skip to content

Commit

Permalink
Add debug logs to dynamic forward proxy failure paths (#28071)
Browse files Browse the repository at this point in the history
Signed-off-by: ohadvano <49730675+ohadvano@users.noreply.github.com>
  • Loading branch information
ohadvano authored Jun 21, 2023
1 parent 8bc87d8 commit 84d0b10
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/extensions/clusters/dynamic_forward_proxy/cluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ Cluster::LoadBalancer::chooseHost(Upstream::LoadBalancerContext* context) {
std::string host = Common::DynamicForwardProxy::DnsHostInfo::normalizeHostForDfp(raw_host, port);

if (host.empty()) {
ENVOY_LOG(debug, "host empty");
return nullptr;
}

Expand All @@ -368,9 +369,11 @@ Cluster::LoadBalancer::chooseHost(Upstream::LoadBalancerContext* context) {
absl::ReaderMutexLock lock{&cluster_.host_map_lock_};
const auto host_it = cluster_.host_map_.find(host);
if (host_it == cluster_.host_map_.end()) {
ENVOY_LOG(debug, "host {} not found", host);
return nullptr;
} else {
if (host_it->second.logical_host_->coarseHealth() == Upstream::Host::Health::Unhealthy) {
ENVOY_LOG(debug, "host {} is unhealthy", host);
return nullptr;
}
host_it->second.shared_host_info_->touch();
Expand Down

0 comments on commit 84d0b10

Please sign in to comment.