wgengine/magicsock: ignore close races even harder.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson 2021-08-30 15:32:06 -07:00 committed by Dave Anderson
parent 8bacfe6a37
commit 86d1c4eceb

View File

@ -289,16 +289,12 @@ func meshStacks(logf logger.Logf, mutateNetmap func(idx int, nm *netmap.NetworkM
m.conn.UpdatePeers(peerSet) m.conn.UpdatePeers(peerSet)
wg, err := nmcfg.WGCfg(nm, logf, netmap.AllowSingleHosts, "") wg, err := nmcfg.WGCfg(nm, logf, netmap.AllowSingleHosts, "")
if err != nil { if err != nil {
if ctx.Err() != nil {
// shutdown race, don't care.
return
}
// We're too far from the *testing.T to be graceful, // We're too far from the *testing.T to be graceful,
// blow up. Shouldn't happen anyway. // blow up. Shouldn't happen anyway.
panic(fmt.Sprintf("failed to construct wgcfg from netmap: %v", err)) panic(fmt.Sprintf("failed to construct wgcfg from netmap: %v", err))
} }
if err := m.Reconfig(wg); err != nil { if err := m.Reconfig(wg); err != nil {
if ctx.Err() != nil { if ctx.Err() != nil || errors.Is(err, errConnClosed) {
// shutdown race, don't care. // shutdown race, don't care.
return return
} }