mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 19:15:34 +00:00
control/controlclient: fix deadlock in shutdown
Fixes a deadlock observed in a different repo.
Regressed in 5b3f5eabb5
.
Updates tailscale/corp#14950
Updates tailscale/corp#14515
Updates tailscale/corp#14139
Updates tailscale/corp#13175
Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
parent
5902d51ba4
commit
3655fb3ba0
@ -473,11 +473,12 @@ func (nc *NoiseClient) dial(ctx context.Context) (*noiseConn, error) {
|
||||
ncc.h2cc = h2cc
|
||||
|
||||
nc.mu.Lock()
|
||||
defer nc.mu.Unlock()
|
||||
if nc.closed {
|
||||
ncc.Close()
|
||||
nc.mu.Unlock()
|
||||
ncc.Close() // Needs to be called without holding the lock.
|
||||
return nil, errors.New("noise client closed")
|
||||
}
|
||||
defer nc.mu.Unlock()
|
||||
mak.Set(&nc.connPool, ncc.id, ncc)
|
||||
nc.last = ncc
|
||||
return ncc, nil
|
||||
|
Loading…
Reference in New Issue
Block a user