mirror of
https://github.com/tailscale/tailscale.git
synced 2024-12-04 23:45:34 +00:00
wgengine/magicsock: don't Rebind after STUN error if closed.
https://github.com/tailscale/tailscale/pull/3014 added a
rebind on STUN failure, which means there can now be a
tailscale.com/wgengine/magicsock.(*RebindingUDPConn).ReadFromNetaddr
in progress at the end of the test waiting for a STUN
response which will never arrive.
This causes a test flake due to the resource leak in those
cases where the Conn decided to rebind. For whatever reason,
it mostly flakes with Windows.
If the Conn is closed, don't Rebind after a send error.
Signed-off-by: Denton Gentry <dgentry@tailscale.com>
(cherry picked from commit def650b3e8
)
This commit is contained in:
parent
46fffa32ed
commit
76ad9d7a7a
@ -616,8 +616,13 @@ func (c *Conn) updateEndpoints(why string) {
|
|||||||
}()
|
}()
|
||||||
c.logf("[v1] magicsock: starting endpoint update (%s)", why)
|
c.logf("[v1] magicsock: starting endpoint update (%s)", why)
|
||||||
if c.noV4Send.Get() {
|
if c.noV4Send.Get() {
|
||||||
c.logf("magicsock: last netcheck reported send error. Rebinding.")
|
c.mu.Lock()
|
||||||
c.Rebind()
|
closed := c.closed
|
||||||
|
c.mu.Unlock()
|
||||||
|
if !closed {
|
||||||
|
c.logf("magicsock: last netcheck reported send error. Rebinding.")
|
||||||
|
c.Rebind()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
endpoints, err := c.determineEndpoints(c.connCtx)
|
endpoints, err := c.determineEndpoints(c.connCtx)
|
||||||
|
Loading…
Reference in New Issue
Block a user