Skip to content

Commit

Permalink
apply review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Kateryna Nezdolii <nezdolik@spotify.com>
  • Loading branch information
Kateryna Nezdolii committed Aug 20, 2019
1 parent 22f49f4 commit f4a1a4a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 19 deletions.
1 change: 0 additions & 1 deletion source/common/upstream/cluster_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,6 @@ void ClusterManagerImpl::onClusterInit(Cluster& cluster) {
// This will drain all tcp and http connection pools.
postThreadLocalDrainConnections(cluster, host_set->hosts());
}
cm_stats_.upstream_connections_closed_on_host_set_change_.inc();
} else {
// TODO(snowp): Should this be subject to merge windows?

Expand Down
1 change: 0 additions & 1 deletion source/common/upstream/cluster_manager_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ class ClusterManagerInitHelper : Logger::Loggable<Logger::Id::upstream> {
COUNTER(cluster_updated_via_merge) \
COUNTER(update_merge_cancelled) \
COUNTER(update_out_of_merge_window) \
COUNTER(upstream_connections_closed_on_host_set_change) \
GAUGE(active_clusters, NeverImport) \
GAUGE(warming_clusters, NeverImport)

Expand Down
17 changes: 0 additions & 17 deletions test/common/upstream/cluster_manager_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3369,11 +3369,6 @@ TEST_F(ClusterManagerImplTest, ConnPoolsDrainedOnHostSetChange) {
0, HostSetImpl::partitionHosts(hosts_ptr, HostsPerLocalityImpl::empty()), nullptr, hosts, {},
100);

// here actually no conn pools are being drained, as this is initial addition of hosts
EXPECT_EQ(
1, factory_.stats_.counter("cluster_manager.upstream_connections_closed_on_host_set_change")
.value());

EXPECT_EQ(1, factory_.stats_.counter("cluster_manager.cluster_updated").value());
EXPECT_EQ(0, factory_.stats_.counter("cluster_manager.cluster_updated_via_merge").value());
EXPECT_EQ(0, factory_.stats_.counter("cluster_manager.update_merge_cancelled").value());
Expand Down Expand Up @@ -3426,10 +3421,6 @@ TEST_F(ClusterManagerImplTest, ConnPoolsDrainedOnHostSetChange) {
0, HostSetImpl::partitionHosts(hosts_ptr, HostsPerLocalityImpl::empty()), nullptr, {},
hosts_removed, 100);

EXPECT_EQ(
2, factory_.stats_.counter("cluster_manager.upstream_connections_closed_on_host_set_change")
.value());

// Recreate connection pool for host1.
cp1 = dynamic_cast<Http::ConnectionPool::MockInstance*>(cluster_manager_->httpConnPoolForCluster(
"cluster_1", ResourcePriority::Default, Http::Protocol::Http11, nullptr));
Expand All @@ -3452,10 +3443,6 @@ TEST_F(ClusterManagerImplTest, ConnPoolsDrainedOnHostSetChange) {
cluster.prioritySet().updateHosts(
0, HostSetImpl::partitionHosts(hosts_ptr, HostsPerLocalityImpl::empty()), nullptr,
hosts_added, {}, 100);

EXPECT_EQ(
3, factory_.stats_.counter("cluster_manager.upstream_connections_closed_on_host_set_change")
.value());
}

TEST_F(ClusterManagerImplTest, ConnPoolsNotDrainedOnHostSetChange) {
Expand Down Expand Up @@ -3521,10 +3508,6 @@ TEST_F(ClusterManagerImplTest, ConnPoolsNotDrainedOnHostSetChange) {
cluster.prioritySet().updateHosts(
0, HostSetImpl::partitionHosts(hosts_ptr, HostsPerLocalityImpl::empty()), nullptr,
hosts_added, {}, 100);

EXPECT_EQ(
0, factory_.stats_.counter("cluster_manager.upstream_connections_closed_on_host_set_change")
.value());
}

} // namespace
Expand Down

0 comments on commit f4a1a4a

Please sign in to comment.