Files
tailscale/cmd
Nick Khyl f3adae29e9 feature/captiveportal: coalesce detection requests and run them async
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]>
2026-11-29 13:15:47 -08:00
..
2026-07-10 14:26:11 -07:00
2026-07-10 14:26:11 -07:00
2026-07-10 14:26:11 -07:00