From 0daf3be9086189a1a26eba658a5a3fc8756b16ab Mon Sep 17 00:00:00 2001 From: Joseph Ezekiel Date: Thu, 8 Oct 2026 21:09:30 +0100 Subject: [PATCH] fix(supervisor): stop shutdown busy loop --- supervisor/supervisor.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/supervisor/supervisor.go b/supervisor/supervisor.go index b2c19e79f28..3a0807bfc46 100644 --- a/supervisor/supervisor.go +++ b/supervisor/supervisor.go @@ -131,6 +131,7 @@ func (s *Supervisor) Run( var backoffTimer <-chan time.Time shuttingDown := false + gracefulShutdownC := s.gracefulShutdownC for { select { // Context cancelled @@ -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 } } }