mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-02 16:01:27 +01:00
wgengine/magicsock: unblock Conn.Synchronize on Conn.Close
I noticed a deadlock in a test in a in-development PR where during a shutdown storm of things (from a tsnet.Server.Close), LocalBackend was trying to call magicsock.Conn.Synchronize but the magicsock and/or eventbus was already shut down and no longer processing events. Updates #16369 Change-Id: I58b1f86c8959303c3fb46e2e3b7f38f6385036f1 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
2ad2d4d409
commit
42ce5c88be
@ -665,7 +665,10 @@ func (c *Conn) Synchronize() {
|
||||
}
|
||||
sp := syncPoint(make(chan struct{}))
|
||||
c.syncPub.Publish(sp)
|
||||
sp.Wait()
|
||||
select {
|
||||
case <-sp:
|
||||
case <-c.donec:
|
||||
}
|
||||
}
|
||||
|
||||
// NewConn creates a magic Conn listening on opts.Port.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user