Skip to content

fix(network): bound tailscale cli calls without waiting for the exit - #1339

Merged
nixuuu merged 1 commit into
devfrom
fix/tailscale-cli-deadline
Nov 27, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/tailscale-cli-deadline

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 27, 2026

Copy link
Copy Markdown
Member

Changes

runCli settled only from execFile's callback, and its timeout only sent
SIGTERM. A child that ignores SIGTERM, cannot be reaped yet (macOS holds
a just-written executable in exec during its first-launch assessment),
or has a descendant holding its output kept the promise pending. The
Tailscale reading is single flight, so one such call stalled every later
refresh. The macOS native check hit this: it hung past its 15 s budget
although runCli had a 10 s deadline.

runCli now owns the deadline: it sends SIGKILL and resolves a failed
result whether or not the exit is reported.

The macOS test now links the bundle CLI path to the system shell and
keeps its checks in a plain script that shell reads, so it still checks
the bundle location, forced CLI mode, the fixed arguments and the empty
PATH without launching a new file. A new test shows that a CLI ignoring
SIGTERM, with a child holding its output, now fails at the deadline
instead of hanging.

Related: #1248
Related: #1292

Verification

  • tests/integration/tailscale-desktop-detection.test.ts repeated on Linux; the new SIGTERM-ignoring CLI test times out with the old runCli and passes with the fix.
  • Not run on macOS locally: the macOS native check in CI covers it.
  • Gateway typecheck, oxlint and oxfmt on edited files. Copy audit: no UI text changed.

🤖 Generated with Claude Code

runCli settled only from execFile's callback, and its timeout only sent
SIGTERM. A child that ignores SIGTERM, cannot be reaped yet (macOS holds
a just-written executable in exec during its first-launch assessment),
or has a descendant holding its output kept the promise pending. The
Tailscale reading is single flight, so one such call stalled every later
refresh. The macOS native check hit this: it hung past its 15 s budget
although runCli had a 10 s deadline.

runCli now owns the deadline: it sends SIGKILL and resolves a failed
result whether or not the exit is reported.

The macOS test now links the bundle CLI path to the system shell and
keeps its checks in a plain script that shell reads, so it still checks
the bundle location, forced CLI mode, the fixed arguments and the empty
PATH without launching a new file. A new test shows that a CLI ignoring
SIGTERM, with a child holding its output, now fails at the deadline
instead of hanging.

Related: #1248
Related: #1292

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 0df9f3512988ef574aa241f9b07f7c0b65420543)
@nixuuu
nixuuu enabled auto-merge (squash) November 27, 2026 16:08
@nixuuu
nixuuu merged commit a8fe8c6 into dev Nov 27, 2026
45 of 47 checks passed
@nixuuu
nixuuu deleted the fix/tailscale-cli-deadline branch November 27, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant