Repository navigation
fix(daemon): preserve recorded ownership through stop and cleanup - #3806
Conversation
|
Size Report
Startup median (7 runs, lower is better):
|
|
The ownership change has one problem that needs a fix before merge, at b7df117. All checks pass, including the device smoke jobs that reuse the shared daemon through the changed code. readReusableLocalDaemon checks for an Not blocking, and you can take or leave these: the test at daemon.test.ts:389 stubs Could the PR be simpler? Keep the central gate in I found the problem by reading the code ( |
|
The managed-takeover finding is valid at A repair is in progress. It will remove the premature owner checks, retain the central no-signal rule, and preserve the typed owner refusal reasons. The regression will exercise managed startup with a dead registered host. The worker will also assess the optional simplifications against both stack layers. After #3806 is repaired, #3797 will be rebased and validated on it. Both layers need fresh independent review and CI before I report them ready again. |
readReusableLocalDaemon rejected an embedded or unknown owner before the central retirement could look at it, so a record whose owner had already exited wedged every managed command instead of recovering. Delete the two client guards and the resolveTimeoutRecovery ownership guard: ownership is judged inside stopAndRetireDaemon on every takeover route (readReusableLocalDaemon, replaceUnreachable, quiesceOrRetireUnresponsive, awaitDrainedDaemon and forceRetireDaemon alike). Map a retained owner reason to the existing typed errors once, in daemonRetirementError for the stop route and daemonTakeoverRetirementError for a takeover, and prove the managed route recovers a crashed embedded or unrecognized owner without signaling it. #3806 (comment)
b7df117 to
f5b44df
Compare
|
Round 2 pushed at Fixed as judged: Regression evidence: new managed-command rows create a real joined child, publish an embedded/unknown/detached record, SIGKILL it, and run a managed request. At Declined with reason: mode rename/ Gate: |
|
The PR is ready. The new managed-route regression and the stop and cleanup changes at f5b44df fix the ownership problem from the earlier review at b7df117, and I found nothing that needs a change. Not blocking: CI has not finished: 12 of 18 checks are still queued or running, and none has failed. Integration Tests and Coverage cover the changed route, including daemon-client startup and ensure, smoke-daemon-clean and the embedded-lifecycle tests. I did not run the new managed-route regression on b7df117, so "it fails there" rests on reading the old guard and its observation path. No conflicts are known. Before merge, Integration Tests, Coverage and the smoke jobs must go green on f5b44df. |
…cord daemon stop --clean checks the record's owner before the stop route reads it, so an unreadable record fails with daemon-clean-not-detached, not daemon-record-unreadable. The help and docs said the latter unconditionally; qualify it with the flag that decides it. #3806 (comment)
|
Independent different-provider review is complete for #3806 at The blocking dead-owner recovery defect is fixed. Managed takeover reaches central retirement; proven-dead embedded and unknown records recover without signals. Live-owner protection remains intact. The fixture, unused host parameter, duplicated registration projections, and string error reconstruction are fixed. Single-mode scaffolding remains a valid optional deferral. The final sentence review confirms that plain unreadable stop reports The exact local receipt |
|
P3 fixed at Gate at exact #3797 rebased to |
Summary
Stop, takeover, drain, and cleanup use ownership and lifetime from one registration read. Central retirement refuses a live embedded or unrecognized owner without a signal. It retires a provably exited owner, so a crashed host cannot block managed startup. Legacy disk records without ownership remain detached.
The review repair removes premature client guards, maps retained owner reasons once, consolidates registration projections, removes an unused parameter, and corrects the embedded-stop fixture. Help and docs distinguish unreadable plain-stop metadata (
daemon-record-unreadable) from the early--cleanrefusal (daemon-clean-not-detached).This prerequisite for #3797 supports #3747 and #3757. It changes 36 files, with 2,212 gross lines. The public host API remains later work.
Validation
Head
e574ba365abbce8766bbed17ff2bae48ae8dd0f4, merge base8e9361a789. The managed-command regression fails at oldb7df117for dead embedded/unrecognized owners and passes at the repair, with no signal to the old owner.pnpm check:affected --run --head e574ba36: 36 runnable checks passed. Receiptrun-k8c1I5:exactCommit=true,checkoutChanged=false. GitHub-owned skips are not passes. This lifecycle change needs no device run.Independent code and smaller-design review approved
f5b44dfa. Independent sentence review approved the final prose ate574ba36; no findings remain. Required CI remains pending.