ipn/ipnlocal: prevent deadlock on WebClientShutdown

WebClientShutdown tries to acquire the b.mu lock, so run it in a go
routine so that it can finish shutdown after setPrefsLockedOnEntry is
finished. This is the same reason b.sshServer.Shutdown is run in a go
routine.

Updates tailscale/corp#14335

Signed-off-by: Will Norris <will@tailscale.com>
This commit is contained in:
Will Norris 2023-11-01 15:26:33 -07:00 committed by Will Norris
parent 7a725bb4f0
commit e7482f0df0
1 changed files with 1 additions and 1 deletions

View File

@ -3013,7 +3013,7 @@ func (b *LocalBackend) setPrefsLockedOnEntry(caller string, newp *ipn.Prefs) ipn
}
}
if oldp.ShouldWebClientBeRunning() && !newp.ShouldWebClientBeRunning() {
b.WebClientShutdown()
go b.WebClientShutdown()
}
if netMap != nil {
newProfile := netMap.UserProfiles[netMap.User()]