mirror of
https://github.com/tailscale/tailscale.git
synced 2025-06-28 19:18:40 +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
|
||||
go func() {
|
||||
started.wg.Wait()
|
||||
started.cancel()
|
||||
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