fix: wait for server tailnet background routines to exit on Close (#15183)

fixes https://github.com/coder/internal/issues/114

We need to wait for ServerTailnet goroutines to finish when closing down, otherwise we can race with the shutdown of coderd & the coordinator, which causes errors.
This commit is contained in:
Spike Curtis
2024-10-23 10:09:56 +04:00
committed by GitHub
parent 343f8ec9ab
commit 32d5875fa4
2 changed files with 24 additions and 9 deletions
+2
View File
@@ -419,6 +419,8 @@ func (s *Server) RegisterNow() error {
}
func (s *Server) Close() error {
s.Logger.Info(s.ctx, "closing workspace proxy server")
defer s.Logger.Debug(s.ctx, "finished closing workspace proxy server")
s.cancel()
var err error