Repository navigation
fix(link): warn once when a stopped one-route child's exit stays unseen, and describe the tunnel drain accurately - #8643
Merged
Conversation
…en, and say the drain covers any tunnel child A one-route child the tick stopped whose exit is still unseen 4 s after the SIGTERM (after its SIGKILL) now logs '[link] tunnel exit unconfirmed link=<id>' once, as a halted candidate does; the link stays failed and owned. The drain comments and structure/remote-link.md say any tunnel child, since stopChild drains multi-route candidates and proven tunnels too. Tests: the tick-stopped drain case now reloads 1.5 s after the tick stop and after the tick's own SIGKILL, so a drain that reset its stop time fails; stale test comments reworded. Refs #8609
… still holds the queue Refs #8609
…n and stopped candidates Refs #8609
Contributor
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Contributor
|
✅ Deterministic PR hygiene checks passed. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
3 tasks done
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.
Summary
The last nits from the final review of #8640 (issue #8609).
A stopped one-route child whose exit was never seen said nothing. Since #8640, the tick sends a failed link's running one-route child SIGTERM and, 2 s later, SIGKILL, and keeps it until its exit is seen. If even SIGKILL produced no observed exit, the link stayed failed with its old reason, a past retry time and a pid, and nothing was logged. A multi-route candidate in the same position already shows
routeBlocked: stop_unconfirmedwith a warning. The tick now warns once,[link] tunnel exit unconfirmed link=<id>(link id only), when the exit is still unseen 4 s (2 x CANDIDATE_KILL_GRACE_MS) after the SIGTERM. The link stays failed and owned, as before.The drain is for any tunnel child.
stopChilddrains every entry of the supervisor's children: one-route tunnels, multi-route candidates and proven multi-route tunnels. Since #8640 each of them gets SIGKILL from the tick after a 2 s grace on reload, removal, reconnect and shutdown, where before the stop waited forever. The comments insrc/link/supervisor.tsand the sentence instructure/remote-link.mdsaid "one-route". They now say any tunnel child and state the timing per case:Carrying route-rounds' own stop time and kill flag into the drain would need that private round state exposed, which is more than the one-line change the review allowed for, so it is left as described.
Tests. The test of a drain on a child the tick already stopped ran the tick stop and the reload at the same clock, so a drain that reset its stop time would also have passed. It is replaced by two tests:
Two stale comments in an older test are reworded. The tick no longer removes the pidfile there; the exit watch does, after the test tunnel exits on SIGTERM.
What keeps this inert. The only behaviour change is one warning line, for a one-route child whose exit stays unseen 4 s after its SIGTERM. Everything else is comments, documentation and tests.
Verification
In
tests/clients/link-route-supervisor.test.ts:a stopped one-route child whose exit is never seen after SIGKILL is warned once: written first. Withsrc/link/supervisor.tsput back todev(61dfb8b), the final test file gives 82 pass and 1 fail, and that test is the failure: no warning.a reload that drains a child the tick stopped 1.5 s earlier sends SIGKILL at the tick's grace, not a fresh oneanda reload that drains a child the tick already sent SIGKILL sends no second one: they test behaviour that fix(link): send SIGKILL to a one-route ssh that ignores SIGTERM, keep a stopped one-route child owned until it exits, and fix orphan wording #8640 added, so they pass ondev. A mutation of the drain that resets its stop time and kill flag (stopAt: now(), killed: false) makes both fail.Commands (exit codes):
TMPDIR=/tmp bun scripts/test.ts --parallel=2 tests/clients/link-route-supervisor.test.ts tests/clients/link-supervisor.test.ts tests/clients/link-boundary.test.ts tests/ci-workflows/structure-ssot.test.ts tests/ci-workflows/ci-structure-gate.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/ci-workflows/file-size-ratchet.test.ts: 214 pass, 0 fail (exit 0).bun run typecheck: exit 0.bun run privacy:scan: exit 0.bun run structure:check: exit 0.structure/remote-link.md:TMPDIR=/tmp bun scripts/test.ts --parallel=2 tests/clients tests/server/link-management-routes.test.ts tests/test-layout.test.ts tests/test-layout-tooling.test.ts tests/ci-workflows/structure-ssot.test.ts tests/ci-workflows/ci-structure-gate.test.ts tests/ci-workflows/file-size-ratchet.test.ts(214 files): 3665 pass, 67 skip, 3 fail (exit 1). The 3 failures are the Rust ocx-child tests (tests/clients/link-ocx-child-e2e.test.ts, two cases, and the Rust case oftests/clients/link-ocx-child-conformance.test.ts). They stop before any test code runs, becausecargoon the build machine has no default rustup toolchain. This branch touches no Rust code.NOT RUN: the full
bun run testsuite (the build machine allows focused files only; CI covers the rest); the three Rust ocx-child tests above (no toolchain); Windows and macOS (one warning line and documentation only).Review: three read-only rounds by one independent reviewer (gpt-6.1-terra, xhigh effort). Rounds 1 and 2 each found a P2 in the drain-timing sentence of
structure/remote-link.md:Both are fixed. Round 3 found no P0–P2 through the head. Round 1 ran the two supervisor test files on the code commit (119 pass) and confirmed that the warning carries only the link id.
Checklist