Repository navigation
fix(daemon): bound the whole boot-recovery sequence with one budget (STA-5732) - #17427
Conversation
Greptile SummaryThis PR applies one 32-second wall-clock budget across daemon adoption and replacement preflight while preserving a final full-window endpoint rescue.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| src/main/daemon/daemon-recovery-budget.ts | Defines the shared 32-second recovery budget and clamps individual probe attempts to its remaining time. |
| src/main/daemon/daemon-launch-paths.ts | Adds timeout-aware socket probing and bounds daemon handshake plus session enumeration under one probe deadline. |
| src/main/daemon/daemon-replacement-preflight.ts | Threads the absolute recovery deadline through preservation checks and terminates wedged-daemon retries when time expires. |
| src/main/daemon/daemon-out-of-process-launcher.ts | Establishes the recovery deadline at launcher entry while intentionally retaining the final endpoint rescue's independent probe window. |
| src/main/daemon/daemon-init-wedged-daemon-grace.test.ts | Covers both recovery-budget bounds and the adopt-versus-replace behavior around transient and permanent daemon wedges. |
| src/main/daemon/daemon-init-endpoint-adoption.test.ts | Verifies degraded endpoint-owner rescue after replacement failure and recovery-budget exhaustion. |
Sequence Diagram
sequenceDiagram
participant S as Startup gate
participant L as Daemon launcher
participant D as Existing daemon
participant R as Replacement daemon
S->>L: Start daemon recovery
L->>L: Set 32-second recovery deadline
L->>D: Budgeted adoption attempt
alt Existing daemon is recoverable
D-->>L: Live sessions
L-->>S: Adopt existing daemon
else Recovery budget expires
L->>D: Kill stale daemon
L->>R: Launch replacement
alt Replacement publishes endpoint
R-->>L: Ready and adopted
L-->>S: Use replacement daemon
else Replacement loses endpoint
L->>D: Full-window rescue probe
D-->>L: Endpoint response
L-->>S: Degraded adoption when completed
end
end
Reviews (5): Last reviewed commit: "fix(daemon): name the socket probe defau..." | Re-trigger Greptile
📝 WalkthroughWalkthroughThe daemon launcher now uses one absolute recovery deadline for adoption and replacement probes. Connection, Merge Risk: 🟡 Moderate · up to The change bounds the main daemon recovery loop, but some preflight and cleanup waits still use independent timeouts and may continue beyond the intended 32-second recovery budget and 60-second startup fail-open limit. That can prolong startup or allow a late daemon transition, so this should be fixed or explicitly accepted by the owner before merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description is complete and directly related to the change. It includes the ELI5 summary, changes, rationale, linked issue, visual proof marked N/A with justification, testing results, review findings, trade-offs, and checklist considerations. The required information is present despite using some headings that differ from the template.
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b140de1f-0c2c-44c8-88f2-0014291695bc
📒 Files selected for processing (12)
src/main/daemon/daemon-init-child-startup-failure.test.tssrc/main/daemon/daemon-init-endpoint-adoption.test.tssrc/main/daemon/daemon-init-fresh-import.tssrc/main/daemon/daemon-init-live-session-preservation.test.tssrc/main/daemon/daemon-init-packaged-bundle-staleness.test.tssrc/main/daemon/daemon-init-replacement-reporting.test.tssrc/main/daemon/daemon-init-test-harness.tssrc/main/daemon/daemon-init-wedged-daemon-grace.test.tssrc/main/daemon/daemon-launch-paths.tssrc/main/daemon/daemon-out-of-process-launcher.tssrc/main/daemon/daemon-recovery-budget.tssrc/main/daemon/daemon-replacement-preflight.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
There was a problem hiding this comment.
Important
The 24 s budget narrows the handshake-wedge grace from the ~60 s #8697 actually shipped (11 retries × 5 s hello timeout) down to ~24 s, and the TRANSIENT_WEDGE_DRAIN_MS = 20 s premise this PR leans on is the pre-widening value from #8697's first commit, not what it settled on. A Windows update-relaunch wedge that drains between ~24 s and ~60 s was adopted before and is now killed.
Reviewed changes
daemon-recovery-budget.ts— New tuning module:TRANSIENT_WEDGE_DRAIN_MS(20 s),DAEMON_RECOVERY_PROBE_MS(8 s),DAEMON_RECOVERY_BUDGET_MS(24 s), anddaemonRecoveryProbeTimeoutMs()which clamps a probe to the remaining deadline.daemon-launch-paths.ts—getAliveDaemonSessionCountnow takes arecoveryDeadlineMs, gives the connect +listSessionsrequest one shared probe slice viaremainingDaemonRequestTimeoutMs, and usesensureConnectedWithinso a wedged handshake can no longer absorb its own fresh 30 s request default.daemon-out-of-process-launcher.ts— Computes onerecoveryDeadlineMs = now + DAEMON_RECOVERY_BUDGET_MSup front, bounds the adoptionensureConnectedWithin, and passes the deadline into the preflight.daemon-replacement-preflight.ts— ThreadsrecoveryDeadlineMsthroughgetAliveDaemonSessionCount/shouldPreserveDaemonWithLiveSessionsand addsDate.now() < recoveryDeadlineMsto the grace loop.- Tests — Mirror
ensureConnectedWithinacross the mock graph, pin the constant relationships, and add a hand-driven-clock suite (runWedgedRecovery) covering the handshake-wedge, listSessions-wedge, and drain-at-the-edge shapes.
⚠️ The previous ~60 s grace floor is removed and not replaced
This change deletes the only test that pinned the grace magnitude — grace budget is generous enough to ride out a ~60s transient wedge, whose comment warned "don't cut without telemetry." The replacement asserts DAEMON_RECOVERY_BUDGET_MS > TRANSIENT_WEDGE_DRAIN_MS (24 s > 20 s), which only rules out budgets below 20 s. Nothing pins the 24 s choice against the ~60 s the old 12-probe loop provided, so the regression range — a handshake wedge draining in 24–60 s — is untested, and a future shrink to 21 s would pass every test while adopting fractionally less.
Technical details
# Grace floor narrowed without a test guarding the 24–60 s range
## Affected sites
- src/main/daemon/daemon-init-wedged-daemon-grace.test.ts — the "~60s transient wedge" guard was deleted; its replacement only pins `budget > TRANSIENT_WEDGE_DRAIN_MS`.
- src/main/daemon/daemon-recovery-budget.ts:6 — `TRANSIENT_WEDGE_DRAIN_MS = 20_000` is described as "the … shape #8697 sized the grace against", but #8697's merged second commit explicitly widened the grace to ~60 s and described ~20 s as the value it was widening *from*.
## Required outcome
- Either back the 24 s number with telemetry showing a transient wedge never drains past ~20 s, or raise `DAEMON_RECOVERY_BUDGET_MS` toward the ~60 s the fail-open cap still absorbs (the test already shows 24 s budget + 9 s relaunch is well under the 60 s cap, leaving ~27 s of headroom).
- Add a behavioral test that asserts a handshake wedge draining in the 24–60 s window is still adopted, so the regression range is guarded rather than incidental.
## Open questions for the human (optional)
- Was the "~20 s drains within" estimate from #8697 ever validated against real Windows update-relaunch events, or was ~60 s chosen purely as "as close to zero loss as possible under the cap"?ℹ️ Nitpicks
- The PR title and
daemon-recovery-budget.tsdescribe "the whole boot-recovery sequence" as bounded, but the deadline only fences the adopt/replace probes:checkDaemonHealth(3 s), the macOS resolver/TCC checks, and the kill/fork/lease all run outside it (guarded only by their own 3 s timeouts or the 60 s cap). Not a bug — the code comment already concedes this — just a gap between the title and what the fence actually covers.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Important
The new recoveryDeadlineMs clamp on the degraded-mode adoption probe (daemon-out-of-process-launcher.ts) is expired by the time that probe runs, which effectively disables the "adopt the daemon that owns the endpoint" safety net in the exact wedge scenario this PR is about.
Reviewed changes
daemon-launch-paths.ts—probeDaemonSocketgains atimeoutMs = 1000parameter so callers can bound the raw socket liveness check.daemon-replacement-preflight.ts— the grace loop'sprobeSocketnow clamps to the remaining recovery deadline, closing the prior ~1 s overshoot past the budget. Correct.daemon-out-of-process-launcher.ts— the catch-all degraded adoption probe is also clamped torecoveryDeadlineMs.
The grace-loop clamp is right. The problem is running the same clamped deadline through the catch-all probe at daemon-out-of-process-launcher.ts:204 (see inline).
Technical details
# Degraded-mode adoption probe is clamped to an already-expired deadline
## Affected sites
- src/main/daemon/daemon-out-of-process-launcher.ts:204 — probeSocket(socketPath, Math.max(1, Math.min(1000, recoveryDeadlineMs - Date.now())))
## Required outcome
- Confirm whether the catch-all adoption probe is meant to stay budgeted. It runs after the adopt-or-replace decision, the fork attempt, and the lease — so recoveryDeadlineMs (24 s from launcher entry) is normally expired at this point, and the clamp yields ~1 ms, causing the probe to nearly always report false and the launcher to throw rather than adopt a live concurrent daemon.
## Open questions for the human (optional)
- Should this probe use a fixed budget (e.g. the previous 1000 ms default) or a fresh deadline, since it guards a late-stage race the budget was not designed to cover?DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
0055e23 to
75c87a8
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Important
This delta cleanly resolves the prior budget-sizing finding, but it does not touch the still-open catch-all adoption-probe clamp at daemon-out-of-process-launcher.ts:203 — that probe still clamps to the (by then expired) recoveryDeadlineMs and collapses to ~1 ms, disabling the degraded-mode adoption fallback. Withholding approval until that is fixed or explicitly confirmed intended.
Reviewed changes
- Resized the budget against the real post-kill tail —
DAEMON_RECOVERY_BUDGET_MS24 s → 32 s, now justified stage-by-stage (kill 10.5 s + fork 10 s + lease 5 s = 25.5 s; 60 − 25.5 leaves 34.5 s, take 32 s, keep 2.5 s margin). - Pinned the floor and ceiling behaviorally — a hand-driven-clock harness (
runWedgedRecovery) now asserts a handshake wedge draining at the 20 s boundary is adopted (not killed), and that a never-draining wedge is killed at exactly the 32 s budget. - Replaced the deleted ~60 s grace guard — the constant test now asserts
budget > TRANSIENT_WEDGE_DRAIN_MSandbudget + relaunch tail < LOCAL_PTY_STARTUP_FAIL_OPEN_TIMEOUT_MS, with the probe/health-check and retry/spin-guard relationships.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
The 24s budget reserved only 9s for everything after the deadline, leaving 27s of the startup PTY gate's fail-open cap unused — and every unused second is one where a daemon that would have drained gets killed with its live PTYs instead. Reserve each post-deadline stage's actual hard cap (kill 10.5s, fork 10s, lease 5s) and spend the rest: 24s -> 32s of adopt window.
…y budget The rescue probe in the launcher's outer catch was clamped to the recovery budget's remainder, but it runs *after* that budget by construction — past prepareDaemonReplacement, killStaleDaemon, the fork and the adoption lease. The remainder is therefore essentially always negative, so Math.max(1, ...) handed a live socket a 1ms connect window. On the loaded machine this path exists for the probe loses to its own timer, the launcher rethrows, and a recoverable degraded adoption becomes total daemon loss for the whole run — the outcome the comment above it exists to prevent. Restore the 1s default and pin the window with a test that drives the launcher to that catch with the budget already spent. Also make the deliberate narrowing legible instead of implicit: - daemon-recovery-budget.ts: TRANSIENT_WEDGE_DRAIN_MS documented 20s as the grace #8697 sized, but #8697's merged second commit (840d327) widened it to 11 retries ~= 60s. Record that 20s is the drain estimate and that the budget deliberately sits under #8697's shipped grace. - daemon-init-wedged-daemon-grace.test.ts: pin the trade directly — a wedge draining after the budget is replaced and loses its live sessions. - Rewrite 'preserves a daemon that stays wedged until the LAST allowed grace retry' onto the simulated clock. It never mocked Date.now, so its 12 probes elapsed ~0ms and asserted a retry grace the wall clock can no longer deliver; it now pins the last drain the budget still adopts.
75c87a8 to
9a95655
Compare
Risk-reduction pass (rebased onto
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Unclamped the last-resort endpoint rescue probe —
daemon-out-of-process-launcher.ts:207is back onprobeSocket(socketPath)with its 1 s default, since the recovery deadline it was clamped to is normally expired by the time this probe runs (after the kill, fork and lease). - Pinned the rescue behaviorally —
daemon-init-endpoint-adoption.test.tsadds "rescues the endpoint owner with a full probe window after the recovery budget is spent", which advances the clock past the budget and asserts a late-answering socket is still adopted rather than lost. - Rewrote the wedge-drain tests onto the hand-driven clock — the old "last allowed grace retry" test now drains at
DAEMON_RECOVERY_BUDGET_MS − 1 sand asserts adoption within budget, and a new test pins the accepted trade of replacing a wedge that drains after the budget. - Corrected the
TRANSIENT_WEDGE_DRAIN_MScomment — it now distinguishes the 20 s drain estimate from the ~60 s grace #8697 actually shipped, matching the prior review's premise correction.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…y rationale Answers the review round on the budget accounting: the outer-catch endpoint rescue is deliberately outside it, and the preflight clamp no longer duplicates probeDaemonSocket's default as a bare literal.
Review round: every open comment answeredHead is now Inline comments1. coderabbitai — 2. pullfrog — 3. pullfrog — 4 & 5. pullfrog — the two "Addressed in …" replies — pullfrog's own confirmations of 2 and 3; no action. pullfrog's latest review at Review-body findings6. pullfrog nitpick — "the title says 'the whole boot-recovery sequence' but the fence only covers the adopt/replace probes" — Accurate. 7. greptile P1 — "Rescue exceeds startup budget" ( My own fresh reviewVerified independently, nothing new blocking:
Verification
Deliberately not changed
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/daemon/daemon-init-wedged-daemon-grace.test.ts (1)
77-77: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueExport and reuse
HEALTH_CHECK_TIMEOUT_MSin the test.
src/main/daemon/daemon-health.tskeeps the constant private, while the test uses a separate3_000value. A future production timeout change can leave the invariant checking a stale value. Export the production constant and import it in the test.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4a543a41-8af2-4ac5-b617-94b8dec11f71
📒 Files selected for processing (12)
src/main/daemon/daemon-init-child-startup-failure.test.tssrc/main/daemon/daemon-init-endpoint-adoption.test.tssrc/main/daemon/daemon-init-fresh-import.tssrc/main/daemon/daemon-init-live-session-preservation.test.tssrc/main/daemon/daemon-init-packaged-bundle-staleness.test.tssrc/main/daemon/daemon-init-replacement-reporting.test.tssrc/main/daemon/daemon-init-test-harness.tssrc/main/daemon/daemon-init-wedged-daemon-grace.test.tssrc/main/daemon/daemon-launch-paths.tssrc/main/daemon/daemon-out-of-process-launcher.tssrc/main/daemon/daemon-recovery-budget.tssrc/main/daemon/daemon-replacement-preflight.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.
…STA-5732) (stablyai#17427) * fix(daemon): bound the whole boot-recovery sequence with one budget (STA-5732) * fix(daemon): keep socket probes inside recovery budget * fix(daemon): size the recovery budget against the real post-kill tail The 24s budget reserved only 9s for everything after the deadline, leaving 27s of the startup PTY gate's fail-open cap unused — and every unused second is one where a daemon that would have drained gets killed with its live PTYs instead. Reserve each post-deadline stage's actual hard cap (kill 10.5s, fork 10s, lease 5s) and spend the rest: 24s -> 32s of adopt window. * fix(daemon): keep the last-resort endpoint rescue outside the recovery budget The rescue probe in the launcher's outer catch was clamped to the recovery budget's remainder, but it runs *after* that budget by construction — past prepareDaemonReplacement, killStaleDaemon, the fork and the adoption lease. The remainder is therefore essentially always negative, so Math.max(1, ...) handed a live socket a 1ms connect window. On the loaded machine this path exists for the probe loses to its own timer, the launcher rethrows, and a recoverable degraded adoption becomes total daemon loss for the whole run — the outcome the comment above it exists to prevent. Restore the 1s default and pin the window with a test that drives the launcher to that catch with the budget already spent. Also make the deliberate narrowing legible instead of implicit: - daemon-recovery-budget.ts: TRANSIENT_WEDGE_DRAIN_MS documented 20s as the grace stablyai#8697 sized, but stablyai#8697's merged second commit (6f08017) widened it to 11 retries ~= 60s. Record that 20s is the drain estimate and that the budget deliberately sits under stablyai#8697's shipped grace. - daemon-init-wedged-daemon-grace.test.ts: pin the trade directly — a wedge draining after the budget is replaced and loses its live sessions. - Rewrite 'preserves a daemon that stays wedged until the LAST allowed grace retry' onto the simulated clock. It never mocked Date.now, so its 12 probes elapsed ~0ms and asserted a retry grace the wall clock can no longer deliver; it now pins the last drain the budget still adopts. * fix(daemon): name the socket probe default and correct the grace-retry rationale Answers the review round on the budget accounting: the outer-catch endpoint rescue is deliberately outside it, and the preflight clamp no longer duplicates probeDaemonSocket's default as a bare literal.

Fixes STA-5732. One of 6 real defects split out of the test-detected-bugs sweep.
ELI5
The app tries to wake a helper daemon on boot. If the daemon is stuck, we politely wait, ask again, wait again… and nobody was holding a stopwatch on the whole sequence. Worst case that's roughly six minutes of an app that looks frozen.
This puts one stopwatch over the entire boot-recovery sequence. When it runs out, we stop being polite and take over.
The interesting part: picking the number
A naive 15 s budget would have silently undone an earlier fix. Commit
840d3277d1d(#8697) deliberately bought a wedged daemon ~20 s of drain grace so a transient stall wouldn't get killed — a 15 s budget preempts exactly that.The budget has a floor and a ceiling, and both are load-bearing:
TRANSIENT_WEDGE_DRAIN_MSDAEMON_RECOVERY_BUDGET_MSDAEMON_RECOVERY_PROBE_MSThe ceiling is
LOCAL_PTY_STARTUP_FAIL_OPEN_TIMEOUT_MS(60 s), because the kill, fork and lease that follow the deadline run inside the same gate. Sized from each stage's own hard cap rather than guessed:killStaleDaemondaemon-process-identity-query.ts) + 3 s SIGTERM wait + 1 s SIGKILL confirm + 0.5 s endpoint probelaunchDaemonChildreadyover IPCdaemon-init-wedged-daemon-grace.test.tspins both bounds, and a behavioral test asserts a daemon draining at the documented 20 s boundary is adopted, not killed.Proof
Revert the daemon product files to
2daea491b96and the daemon suite fails:At HEAD:
147 passed | 2 skipped,1701 passed.Notes
shouldPreserveDaemonWithLiveSessionsstill preserves onliveSessionCount === null— an unverifiable live-session count is never read as "no sessions."killOutcome.liveOwnerSurvivedstill degrades to adopt rather than forking beside an unproven-dead daemon.catchindaemon-out-of-process-launcher.ts) is deliberately not budget-clamped. It runs after the budget by construction — pastprepareDaemonReplacement,killStaleDaemon, the fork and the lease — so the remainder is essentially always negative andMath.max(1, ...)would hand a live socket a 1 ms connect window. An earlier revision of this PR clamped it; that turned a recoverable degraded adoption into total daemon loss for the run. It is back onprobeDaemonSocket's own 1 s default and pinned bydaemon-init-endpoint-adoption.test.ts→ "rescues the endpoint owner with a full probe window after the recovery budget is spent".User-Facing Trade-offs
There is one, and it is a real regression window. An earlier revision of this section claimed "None"; that was wrong.
The grace loop's exit is now a wall clock, so a wedged daemon that drains after the clock expires is killed along with its live PTY sessions — where the old code would have waited and adopted it.
Measured window. For the canonical wedge (socket accepts connections, hello never answers) the old code spent, from launcher entry: ~5 s unbudgeted adoption connect + 3 s health check + ~5 s initial
listSessionsprobe + 11 grace retries at ~5 s each ≈ 65 s of effective grace. The new code stops at 32 s. So a wedge draining between ~32 s and ~65 s is preserved by the old code and killed by the new code. Below 32 s, both adopt. Above ~65 s, both kill — and the old code also blew the 60 s fail-open gate first, so the user lost the sessions and watched the app hang. That is STA-5732.What was done about it. The window was originally ~24 s–65 s. Auditing the post-deadline tail showed the 24 s budget reserved only 9 s for a tail whose real hard caps total 25.5 s — against a 60 s gate, so 27 s of the gate was simply unused. Widening the budget to 32 s buys back ~8 s of adopt window at zero cost to the fix: it strictly widens the preserve path, and the total still fits the gate by construction (32 + 25.5 = 57.5 < 60).
Why the window cannot be closed entirely. The natural mitigation — "on budget exhaustion, adopt the still-answering daemon in degraded mode instead of killing it" — was considered and rejected:
killOutcome.liveOwnerSurvivednet already covers every case where the kill is unverifiable: a missing or unparseable PID record, a failed identity inspection,EPERMfrom another user's daemon, or a SIGTERM/SIGKILL whose exit cannot be confirmed. All of those adopt in degraded mode and keep the sessions (covered bydaemon-init-endpoint-adoption.test.ts, "degrades instead of forking beside a daemon that could not be confirmed stopped"). Sessions are only lost when the kill positively succeeds.daemon-entry.ts:204), a wedged event loop never runs it, so the SIGKILL at t+3 s lands. That is exactly the case the window is about, so the existing net does not cover it.DegradedDaemonPtyProvider.discoverDaemonSessions()then runslistSessionsagainst that same never-answering socket with the client's unbudgeted defaults (5 s connect + 30 s request), inside the same 60 s gate. That is a new startup hang, i.e. it reintroduces the bug this PR fixes.So the residual risk is irreducible without new persistent state to distinguish "wedged this boot" from "wedged every boot", which is out of scope here. The trade is: a ~33 s window in which a slow-draining daemon loses its sessions, in exchange for never again hanging startup for minutes and losing them anyway.
Also residual: the recovery deadline uses wall-clock
Date.now(); a clock jump during startup would shorten or lengthen the budget. Not expected during startup and not a proven release issue.Readiness review
Verdict: PASS after one fix-loop iteration. The review found and fixed a bounded P2 reliability issue: socket liveness probes now use the remaining recovery deadline, so the boot-recovery budget is enforced for the grace loop and post-failure adoption path.
Checklist status:
daemon-init-wedged-daemon-grace.test.ts→ "replaces a wedge that drains after the recovery budget (accepted trade vs fix(daemon): replace a permanently wedged daemon instead of preserving it forever (#8689) #8697)" rather than left implicit.Visual proof: N/A — this is a main-process daemon recovery change with no UI or interaction changes.
Testing
pnpm test src/main/daemon/— 147 files passed, 2 skipped; 1,701 tests passed, 3 skippedpnpm tc— cleanoxlint src/main/daemon/— cleanpnpm run check:code-quality:changed— 0 new findings across 12 changed filesPerformance Measurement
The previous boot-recovery retry sequence had no whole-sequence deadline (≈9.4 min worst case: 11 retries × unbudgeted 5 s connect + 30 s request). The new
DAEMON_RECOVERY_BUDGET_MSbounds it at 32 s, with a further ≤25.5 s of kill/fork/lease before the 60 s startup fail-open gate.