Repository navigation
fix(update): interrupted updates hang on a healthy Gateway and large-state admission times out - #193263
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis 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. |
|
Codex review: needs changes before merge. What this changesThis PR cancels interrupted Gateway readiness polling and sizes candidate admission timeouts from measured SQLite state. Example: SIGTERM arrives while an update verifies a healthy systemd Gateway.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR: both updater defects remain on current main, and the proposed production fixes are focused, but the test refactor introduces a type error. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe installed updater supervises candidate admission and Gateway restart verification, consuming state measurements, service observations, and cancellation signals to produce admission or recovery results. flowchart TD
A[Update CLI] --> B[Installed updater]
B --> C[Measured SQLite inspection budget]
C --> D[Candidate admission]
B --> E[Gateway readiness owner]
F[Command scope cancellation] --> E
E --> G[Existing recovery and reporting]
Technical reviewBest possible solution: Retain the existing cancellation and inspection-budget owners, and repair the port fixture’s type without changing production behavior. Do we have a high-confidence way to reproduce the issue? Current-main source supports both failure paths, and the author supplies comparative native Linux results; this read-only review did not execute the reproduction. Is this the best way to solve the issue? The production approach restores cancellation and measured-budget invariants through existing owners without adding another lifecycle or admission path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c6a601f68e74. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +28, Tests +12, Docs +12, Other +2. Total +54 across 10 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 5, 2026, 2:08 AM ET / 07:08 UTC. |
|
Merged via squash auto-merge.
|
…state admission times out (#193263) * fix(update): size candidate admission to measured state * fix(update): stop waiting on a cancelled readiness scope * docs(update): describe interrupted readiness and admission allowance * test(update): trim interrupted readiness and admission coverage * test(update): restore running-service requirement in the cancellation regression * test(update): type the stalled port fixtures with the shared helper Backport-source: 57f8e4b Backport-scope: Use inherited process cancellation; calculate bounded default admission timeout only when unspecified. Adapt source size.bytes to C1 capacity.sqliteBytes; preserve explicit timeout, step cap, fallback and currentness. Adapted production backport for release/2026.11.2. Upstream validation descriptions refer to source history; candidate regression coverage and remote qualification are tracked separately. Co-authored-by: RomneyDa <[email protected]>
…state admission times out (openclaw#193263) * fix(update): size candidate admission to measured state * fix(update): stop waiting on a cancelled readiness scope * docs(update): describe interrupted readiness and admission allowance * test(update): trim interrupted readiness and admission coverage * test(update): restore running-service requirement in the cancellation regression * test(update): type the stalled port fixtures with the shared helper
…193263) Backport command-scope cancellation and measured-state admission budgets to the stable update owners. Preserve explicit timeouts and existing authority checks; retain existing interruption recovery documentation. (cherry picked from commit 57f8e4b) Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Fixes: an update interrupted with Ctrl-C or
SIGTERMwhile verifying the restarted Gateway can sit for up to the update deadline printingservice=unknown ... health=ready, even though the Gateway is healthy. Also fixes: on large state databases, candidate admission times out at a fixed 120 s and silently falls back to the installed updater's older checks.User Impact
User impact: an interrupted update now exits within seconds and leaves a healthy Gateway running, with the interruption reported instead of an apparent hang. Installs with a large state database now get the target release's own admission checks, as small installs do. No config, schema, or protocol change.
Why This Change Was Made
A signal stops the update's forward command scope so its children end. Readiness polling kept running in that scope, so every new
systemctldied at spawn, the unit read asunknown, andhealth=readycould never satisfy the managed-service requirement.waitForGatewayHealthyRestartnow honours the enclosing scope's cancellation; the existing recovery path takes over from there.Candidate admission passed
prepared.timeoutMs, unset by default, so it used a fixed 120 s even though the step budget is 30 minutes. It now uses the inspection allowance derived from measured SQLite bytes, the same owner the rehearsal uses, capped by the step deadline. An explicit--timeoutis unchanged. A candidate that hangs now takes longer to fall back; the Gateway is still serving during admission, so I accepted that.The installed updater runs the first hop, so hops driven by a published updater keep today's behavior until a release containing this fix is the driver.
Evidence
Native proof on Crabbox AWS Linux (c7a.8xlarge), systemd Gateway, process-group
SIGTERM:5375b69c89b)SIGTERMatPhase: verifying, small stateservice=unknown30 times while systemd said active/running/readyzready, 0service=unknownlinesSIGTERMatPhase: verifying, 3 GB state/readyzready, 0service=unknownlinesAdmission fallback: timeout)Update safety checks ran in the candidate updaterThe diagnostic that identified the cause, from a patched driver:
systemctl --user status: signal; Command was terminated.Total time rises because admission now finishes instead of being abandoned. Timing comes from single runs and is not a clean A/B. Native proof ran on
6217c196307; later commits change only docs and tests.Tests:
promise resolved ... instead of rejecting) and passes with it.$autoreviewis scoped-clean and an independent Codex review returned NO FINDINGS.Gaps:
Failed to reconcile gateway service ... AbortErrorwarning before recovery reports the interruption.rollback-state-unverified, on main and with this fix.openclaw update repairexits 0 and namesopenclaw gateway start. That cause is not traced here.Test lines: this adds a justified net 10 lines, recorded in
config/test-lines-allocations/update-interrupted-readiness-admission-budget.txt.