Skip to content

Commit

Permalink
Send tunnel reconnects before waiting for sessions to drain (#24141)
Browse files Browse the repository at this point in the history
  • Loading branch information
dboslee committed Apr 5, 2023
1 parent 35f9e42 commit 7e88827
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/reversetunnel/srv.go
Expand Up @@ -613,8 +613,6 @@ func (s *server) Close() error {
func (s *server) DrainConnections(ctx context.Context) error {
// Ensure listener is closed before sending reconnects.
err := s.srv.Close()
s.srv.Wait(ctx)

s.RLock()
s.log.Debugf("Advising reconnect to local site: %s", s.localSite.GetName())
go s.localSite.adviseReconnect(ctx)
Expand All @@ -625,6 +623,7 @@ func (s *server) DrainConnections(ctx context.Context) error {
}
s.RUnlock()

s.srv.Wait(ctx)
return trace.Wrap(err)
}

Expand Down

0 comments on commit 7e88827

Please sign in to comment.