Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions source/common/upstream/original_dst_cluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,16 +160,18 @@ void OriginalDstCluster::cleanup() {
// Given the current config, only EDS clusters support multiple priorities.
ASSERT(priority_set_.hostSetsPerPriority().size() == 1);
const auto& host_set = priority_set_.getOrCreateHostSet(0);

ENVOY_LOG(debug, "Cleaning up stale original dst hosts.");
for (const HostSharedPtr& host : host_set.hosts()) {
if (host->used()) {
ENVOY_LOG(debug, "Keeping active host {}.", host->address()->asString());
new_hosts->emplace_back(host);
host->used(false); // Mark to be removed during the next round.
} else {
ENVOY_LOG(debug, "Removing stale host {}.", host->address()->asString());
to_be_removed.emplace_back(host);
ENVOY_LOG(trace, "Stale original dst hosts cleanup triggered.");
if (!host_set.hosts().empty()) {
ENVOY_LOG(debug, "Cleaning up stale original dst hosts.");
for (const HostSharedPtr& host : host_set.hosts()) {
if (host->used()) {
ENVOY_LOG(debug, "Keeping active host {}.", host->address()->asString());
new_hosts->emplace_back(host);
host->used(false); // Mark to be removed during the next round.
} else {
ENVOY_LOG(debug, "Removing stale host {}.", host->address()->asString());
to_be_removed.emplace_back(host);
}
}
}

Expand Down