ipn/ipnlocal: add missing context cancel

If user's fn returned false and never canceled their ctx, we never
stopped the NotifyWatchEngineUpdates goroutine.

This was introduced recently (this cycle).

Change-Id: I3453966ac71e00727296ddd237ef845782f4e52e
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
pull/6586/head
Brad Fitzpatrick 2 years ago committed by Brad Fitzpatrick
parent 978d6af91a
commit a277eb4dcf

@ -1757,6 +1757,8 @@ func (b *LocalBackend) WatchNotifications(ctx context.Context, mask ipn.NotifyWa
// request every 2 seconds. // request every 2 seconds.
// TODO(bradfitz): plumb this further and only send a Notify on change. // TODO(bradfitz): plumb this further and only send a Notify on change.
if mask&ipn.NotifyWatchEngineUpdates != 0 { if mask&ipn.NotifyWatchEngineUpdates != 0 {
ctx, cancel := context.WithCancel(ctx)
defer cancel()
go b.pollRequestEngineStatus(ctx) go b.pollRequestEngineStatus(ctx)
} }

Loading…
Cancel
Save