Repository navigation
fix(network): bound tailscale cli calls without waiting for the exit - #1339
Merged
Merged
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tsrepeated on Linux; the new SIGTERM-ignoring CLI test times out with the oldrunCliand passes with the fix.🤖 Generated with Claude Code