diff --git a/source/common/conn_pool/conn_pool_base.cc b/source/common/conn_pool/conn_pool_base.cc index 706ba1c1e4c8c..f1dfbbcfeeade 100644 --- a/source/common/conn_pool/conn_pool_base.cc +++ b/source/common/conn_pool/conn_pool_base.cc @@ -364,6 +364,8 @@ void ConnPoolImplBase::drainConnectionsImpl() { // so all remaining entries in ready_clients_ are serving streams. Move them and all entries // in busy_clients_ to draining. while (!ready_clients_.empty()) { + ENVOY_LOG_EVENT(debug, "draining_ready_client", "draining active client {} for cluster {}", + ready_clients_.front()->id(), host_->cluster().name()); transitionActiveClientState(*ready_clients_.front(), ActiveClient::State::DRAINING); } @@ -371,6 +373,8 @@ void ConnPoolImplBase::drainConnectionsImpl() { // so use a for-loop since the list is not mutated. ASSERT(&owningList(ActiveClient::State::DRAINING) == &busy_clients_); for (auto& busy_client : busy_clients_) { + ENVOY_LOG_EVENT(debug, "draining_busy_client", "draining busy client {} for cluster {}", + busy_client->id(), host_->cluster().name()); transitionActiveClientState(*busy_client, ActiveClient::State::DRAINING); } } diff --git a/source/common/upstream/cluster_manager_impl.cc b/source/common/upstream/cluster_manager_impl.cc index cd3be72d7d5d7..8017ae0140254 100644 --- a/source/common/upstream/cluster_manager_impl.cc +++ b/source/common/upstream/cluster_manager_impl.cc @@ -782,6 +782,9 @@ ClusterManagerImpl::loadCluster(const envoy::config::cluster::v3::Cluster& clust if (new_cluster->outlierDetector() != nullptr) { new_cluster->outlierDetector()->addChangedStateCb([this](HostSharedPtr host) { if (host->healthFlagGet(Host::HealthFlag::FAILED_OUTLIER_CHECK)) { + ENVOY_LOG_EVENT(debug, "outlier_detection_ejection", + "host {} in cluster {} was ejected by the outlier detector", + host->address(), host->cluster().name()); postThreadLocalHealthFailure(host); } }); @@ -946,6 +949,9 @@ ClusterManagerImpl::ThreadLocalClusterManagerImpl::ClusterEntry::tcpConnPool( } void ClusterManagerImpl::drainConnections(const std::string& cluster) { + ENVOY_LOG_EVENT(debug, "drain_connections_call", "drainConnections called for cluster {}", + cluster); + tls_.runOnAllThreads([cluster](OptRef cluster_manager) { auto cluster_entry = cluster_manager->thread_local_clusters_.find(cluster); if (cluster_entry != cluster_manager->thread_local_clusters_.end()) { @@ -955,6 +961,9 @@ void ClusterManagerImpl::drainConnections(const std::string& cluster) { } void ClusterManagerImpl::drainConnections() { + ENVOY_LOG_EVENT(debug, "drain_connections_call_for_all_clusters", + "drainConnections called for all clusters"); + tls_.runOnAllThreads([](OptRef cluster_manager) { for (const auto& cluster_entry : cluster_manager->thread_local_clusters_) { cluster_entry.second->drainConnPools();