Skip to content
Open
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
5 changes: 4 additions & 1 deletion supervisor/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func (s *Supervisor) Run(
var backoffTimer <-chan time.Time

shuttingDown := false
gracefulShutdownC := s.gracefulShutdownC
for {
select {
// Context cancelled
Expand Down Expand Up @@ -175,8 +176,10 @@ func (s *Supervisor) Run(
// No more tunnels outstanding, clear backoff timer
backoff.SetGracePeriod()
}
case <-s.gracefulShutdownC:
case <-gracefulShutdownC:
shuttingDown = true
// Avoid making the loop spin while the tunnels drain.
gracefulShutdownC = nil
}
}
}
Expand Down