mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-30 21:42:48 -08:00
onHealthChange signaled the detection loop over an unbuffered channel. While the loop was busy running detection, which can take several seconds per interface, the eventbus subscriber was blocked and reported as slow. Additionally, every health change while connectivity remained impacted requested another detection, including the change that detection itself made to the captive portal warnable. Replace the loop and the channel with a coalescedop: requests never block, and those that arrive during a check cause exactly one more check after it. Ignore changes to the captive portal warnable itself, and log when detection runs instead of on every health change. Without a loop to start and stop on backend state changes, detection is now limited by the WantRunning pref alone, which was already required. A change to it triggers a check, as does Init. Updates #15396 Updates #21703 Signed-off-by: Nick Khyl <[email protected]>