Skip to content

Commit

Permalink
Remove unnecessary drain grace timer when empty connections
Browse files Browse the repository at this point in the history
  • Loading branch information
yashykt committed Jan 6, 2025
1 parent a86b31c commit a920e9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/core/server/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ void Server::ListenerState::RemoveLogicalConnection(
}

void Server::ListenerState::DrainConnectionsLocked() {
if (connections_.empty()) {
return;
}
// Send GOAWAYs on the transports so that they disconnect when existing
// RPCs finish.
for (auto& connection : connections_) {
Expand Down
4 changes: 0 additions & 4 deletions test/cpp/end2end/xds/xds_enabled_server_end2end_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,6 @@ TEST_P(XdsEnabledServerStatusNotificationTest, RepeatedServingStatusChanges) {
}

TEST_P(XdsEnabledServerStatusNotificationTest, ExistingRpcsOnResourceDeletion) {
// Send a valid LDS update to get the server to start listening
SetValidLdsUpdate();
StartBackend(0);
ASSERT_TRUE(backends_[0]->WaitOnServingStatusChange(grpc::StatusCode::OK));
constexpr int kNumChannels = 10;
Expand Down Expand Up @@ -356,8 +354,6 @@ TEST_P(XdsEnabledServerStatusNotificationTest,
ExistingRpcsFailOnResourceUpdateAfterDrainGraceTimeExpires) {
constexpr int kDrainGraceTimeMs = 100;
xds_drain_grace_time_ms_ = kDrainGraceTimeMs;
// Send a valid LDS update to get the server to start listening
SetValidLdsUpdate();
StartBackend(0);
ASSERT_TRUE(backends_[0]->WaitOnServingStatusChange(grpc::StatusCode::OK));
constexpr int kNumChannels = 10;
Expand Down

0 comments on commit a920e9b

Please sign in to comment.