Repository navigation
fix(link): warn once when a draining stop holds the lifecycle queue on an exit never seen, and finish the drain wording - #8646
Merged
Conversation
…topped candidate Refs #8609
…n an exit never seen A stop from a reload, removal, reconnect or shutdown whose child survives SIGKILL awaits an exit that never comes and held the lifecycle queue silently. The tick's drain loop now logs '[link] tunnel exit unconfirmed link=<id>' once when the exit is still unseen 4 s after the drain's stop time, unless the tick already warned for that child. Refs #8609
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
lidge-jun
added a commit
that referenced
this pull request
Nov 13, 2026
Brings in dev through de85cf2, including #8638 (operation journal follow-ups: strict revoke intents, a link suspended after an uncertain revoke, journal size bounds, write-only-on-change) and #8646. Conflict resolution keeps both sides: - operations-journal: dev's bounded pruning and write-only-on-change, with this PR's keep pin honoured by both the retention filter and the over-limit prune. - link-operation: dev's room check, live marks, strict intents and cleanupNotRun/release on RevokeJournal, with this PR's pinned writes, operationId and beforeReceiptCleared; the resumed retirement journal gets no-op cleanupNotRun/release (its link is held for the resume). - link-routes remove(): the early replay branch resumes the operation's own receipt before replaying; dev's 404/409/400 order and plain-force open-entry exemption stay, and a plain force still settles and disowns an open owner's receipt. - link-routes removeReserved(): this PR's receipt flow (listed check, cleanup evidence, mode check, claim before the locked commit) with dev's first intent before stopLink, strict key/record intents (the record intent inside the locked step, before the store write), the cleanup-failure rule and the live-mark release.
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 #8643 (issue #8609).
A stuck drain was silent. A stop from a reload, removal, reconnect or shutdown sends a tunnel child SIGTERM, and the tick sends SIGKILL once 2 s have passed since the stop time (#8640; a child the tick had already stopped keeps the tick's earlier stop time). The stop then awaits the child's exit. If even SIGKILL produced no observed exit, that await held the lifecycle queue for every link and nothing was logged. The tick's drain loop, which already visits every draining child, now logs
[link] tunnel exit unconfirmed link=<id>once (link id only) when the exit is still unseen at least 4 s (2 x CANDIDATE_KILL_GRACE_MS) after the drain's stop time. The warning is a separate branch from the SIGKILL, so it needs a tick after the SIGKILL tick. That is the same line the tick logs for a stopped one-route child since #8643. A one-route child the tick already warned about keeps that flag when a stop drains it, so the line is not logged twice for it. A multi-route candidate that route-rounds halted withstop_unconfirmedkeeps its own[link] route candidate exit unconfirmed link=<id>line and, once a stop drains it, gets this one too, after a second, harmless SIGKILL. Nothing else changes: the stop still waits, and the SIGKILL timing is as before.Wording.
src/link/supervisor.tsis now a full sentence and also names the fresh grace that a candidate route-rounds already stopped gets when drained.structure/remote-link.mdsays the tick-branch warning comes "at least 4 s" after the SIGTERM, because it needs a tick after the SIGKILL tick. It also says that a draining stop whose exit is never seen is now warned once: not again for a one-route child the tick already warned about, and as well for a candidate halted withstop_unconfirmed.stopChild, which is where it is set.What keeps this inert. The only behaviour change is one warning line, for a stop whose child is still not seen to exit at least 4 s after its stop time, which in practice means it survived SIGKILL.
src/link/supervisor.tsgrows from 1000 to 1006 lines; the file-size ratchet applies from 2000 lines. No hunk touches the import block orspawnFor.Verification
In
tests/clients/link-route-supervisor.test.ts:a reload whose drained child survives SIGKILL warns once while it holds the lifecycle queue: written first. It asserts no warning at 3.999 s, exactly one at 4 s, and no repeat at 5 s. Withsrc/link/supervisor.tsput back todev(d6ab332), the final test file gives 84 pass and 1 fail, and this test is the failure: no warning.a drained child the tick already warned about is not warned again by the drain: guards the carried flag. It passes ondev, which has no drain warning at all. A mutation that drops the carried flag (warned: false) makes it fail.Commands (exit codes). The first two were run on 110a18e, and the head adds only wording:
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: 216 pass, 0 fail (exit 0).bun run typecheck: exit 0.bun run privacy:scan: exit 0.bun run structure:check: exit 0.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): 3667 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).The branch has six commits:
stop_unconfirmed.The last two change only that doc sentence and that comment. After them, the two supervisor test files (
TMPDIR=/tmp bun test tests/clients/link-route-supervisor.test.ts tests/clients/link-supervisor.test.ts: 121 pass, 0 fail, exit 0),bun run typecheck,bun run structure:checkandbun run privacy:scan(exit 0 each) were run again on the head.Review: two read-only rounds by one independent reviewer (gpt-6.1-terra, xhigh effort). Round 1 found one P2: the timing test checked at 5 s, so a warning that first came at 5 s would also have passed. That is fixed in the last commit. Round 1 also confirmed that the drain loop sends SIGKILL before it warns, that the warning carries only the link id, and that the warned flag is carried over. Round 2 found no P0–P2 and ran the test file on the head (85 pass).
Checklist