mirror of
https://github.com/tailscale/tailscale.git
synced 2025-06-29 11:38:39 +00:00
wgengine/magicsock: fix relayManager alloc work cleanup (#16387)
Premature cancellation was preventing the work from ever being cleaned up in runLoop(). Updates tailscale/corp#27502 Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
parent
37eca1785c
commit
51d00e135b
@ -743,8 +743,11 @@ func (r *relayManager) allocateAllServersRunLoop(ep *endpoint) {
|
|||||||
r.allocWorkByEndpoint[ep] = started
|
r.allocWorkByEndpoint[ep] = started
|
||||||
go func() {
|
go func() {
|
||||||
started.wg.Wait()
|
started.wg.Wait()
|
||||||
started.cancel()
|
|
||||||
relayManagerInputEvent(r, ctx, &r.allocateWorkDoneCh, relayEndpointAllocWorkDoneEvent{work: started})
|
relayManagerInputEvent(r, ctx, &r.allocateWorkDoneCh, relayEndpointAllocWorkDoneEvent{work: started})
|
||||||
|
// cleanup context cancellation must come after the
|
||||||
|
// relayManagerInputEvent call, otherwise it returns early without
|
||||||
|
// writing the event to runLoop().
|
||||||
|
started.cancel()
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user