mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-04 00:41:46 +01:00
feature/relayserver: fix Shutdown() deadlock (#17898)
Updates #17894 Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
parent
124301fbb6
commit
0285e1d5fb
@ -246,10 +246,13 @@ func (e *extension) stopRelayServerLocked() {
|
|||||||
|
|
||||||
// Shutdown implements [ipnlocal.Extension].
|
// Shutdown implements [ipnlocal.Extension].
|
||||||
func (e *extension) Shutdown() error {
|
func (e *extension) Shutdown() error {
|
||||||
|
// [extension.mu] must not be held when closing the [eventbus.Client]. Close
|
||||||
|
// blocks until all [eventbus.SubscribeFunc]'s have returned, and the ones
|
||||||
|
// used in this package also acquire [extension.mu]. See #17894.
|
||||||
|
e.ec.Close()
|
||||||
e.mu.Lock()
|
e.mu.Lock()
|
||||||
defer e.mu.Unlock()
|
defer e.mu.Unlock()
|
||||||
e.shutdown = true
|
e.shutdown = true
|
||||||
e.ec.Close()
|
|
||||||
e.stopRelayServerLocked()
|
e.stopRelayServerLocked()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user