Skip to content

fix(backup): backups and updates fail on slow storage when a header probe batch misses its deadline - #194239

Merged
steipete merged 9 commits into
mainfrom
codex/issue-193962-probe-slow-storage
Nov 6, 2026
Merged

steipete merged 9 commits into
mainfrom
codex/issue-193962-probe-slow-storage

Conversation

@steipete

@steipete steipete commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: openclaw backup create and update backup discovery still fail with SQLite header probe timed out on slow or cold storage, because 4,096 paths can miss the 10-second deadline even after #187197 batched them.

Refs #193962, #187150

User Impact

Backups and updates now finish on slow disks instead of refusing. A path that can't answer on its own still refuses the backup, and how long that takes is bounded. This needs a release containing it as the updater; it does not repair an installed 2026.10.10 or 2026.11.1 updater.

The docs also gain the recovery for those installed updaters, which we ran end to end: warm the file cache and retry, or take the manual hop using openclaw backup create --no-include-workspace --verify.

Why This Change Was Made

#187197 gives each 4,096-path batch its own 10 s deadline, which works down to about 410 paths per second. Cold reads on spinning disks, NAS volumes and SD cards can be slower than that, and then the backup fails even though every file is readable.

When a child reports ETIMEDOUT, probeSqliteHeaderBatch now splits that batch in half and retries each half with the same deadline. A batch that does finish still answers every path it was given, and results are validated as before. Only a single path that can't answer in 10 s rethrows, which keeps the existing refusal, its message, and the link to the manual procedure.

Rejected: raising the deadline, because a hung mount would then block for longer before anything is refused. Rejected: treating a timed-out path as non-SQLite, because that would fail open.

Accepted cost: on a filesystem where one path hangs, the refusal now comes after up to 13 timeouts (about 130 s) instead of 10 s, since the batch has to split down to that path.

Evidence

Real CLI backup create on Crabbox (AWS Linux, Node 24.22.1), with a cold cache, on a dm-delay device adding 10 ms to reads, 20,150 paths:

Build Result
main 2a2cd29 rc=1 in 20 s, SQLite header probe timed out after 10000 ms while checking 20150 backup paths
this branch 02c7477 rc=0 in 241 s; backup verify scanned 20,154 entries and verified the SQLite inventory

Later commits on this branch change only docs and the test file, plus a merge of main. The test file nets zero added lines.

Regression test: the new case in src/infra/sqlite-header-probe.test.ts fails on base and passes with the fix. The existing timeout-refusal case and backup-create.sqlite-header-probe.test.ts pass. Lint and the core and core-test typechecks pass locally. $autoreview is scoped-clean at P2 and an independent Codex review returned NO FINDINGS.

The docs claims come from native runs on published builds, 320,000 small files under ~/.openclaw/workspace, 4 vCPU, EBS, cold cache:

Path Result
10.10 → 11.1 openclaw update rc=1, spawnSync node ETIMEDOUT, Gateway stays healthy on 10.10
Warm the cache, then the same update rc=0 in 959 s, healthy on 11.1
10.10 full backup create --verify rc=1 in 33 s
10.10 backup create --no-include-workspace --verify rc=0 in 6 s
Manual hop to @latest, and to 2026.11.5-beta.1 healthy on the target, all files present
main 2a2cd29 updater → relabelled main rc=0 in 342 s, healthy; worst batch 3.65 s of 79

The warmed retry isn't guaranteed: one warmed full backup timed out while a heavy build saturated the box, and the docs say it depends on the host. Not run on Windows or macOS.

No schema, protocol or config change.

@clawsweeper

clawsweeper Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S labels Nov 6, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-06T17:34:19.210051Z e5ad237 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 6, 2026
@steipete
steipete merged commit 000542f into main Nov 6, 2026
116 of 118 checks passed
@steipete
steipete deleted the codex/issue-193962-probe-slow-storage branch November 6, 2026 17:47
@steipete

steipete commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 7, 2026
…robe batch misses its deadline (openclaw#194239)

* fix(backup): split SQLite header probe batches that miss their deadline

* test(backup): cover SQLite header probe batch splitting

* docs(update): add the cold-cache retry for large state header-probe timeouts

* docs(update): keep the header-probe guidance to what was measured

* test(backup): type the header probe split regression with the mock's own shape

* test(backup): fold the header probe split regression into the existing suite

* test(backup): keep the header probe suite net zero

* test(backup): shorten the header probe timeout expectation
RomneyDa added a commit that referenced this pull request Nov 9, 2026
…robe batch misses its deadline (#194239)

* fix(backup): split SQLite header probe batches that miss their deadline

* test(backup): cover SQLite header probe batch splitting

* docs(update): add the cold-cache retry for large state header-probe timeouts

* docs(update): keep the header-probe guidance to what was measured

* test(backup): type the header probe split regression with the mock's own shape

* test(backup): fold the header probe split regression into the existing suite

* test(backup): keep the header probe suite net zero

* test(backup): shorten the header probe timeout expectation

(cherry picked from commit 000542f)

Release adaptation: Apply the selected timeout splitting implementation and unit tests unchanged; adapt only the documentation context to preserve release guidance. Independent Windows busy-file and engine-anchor changes are not prerequisites and are excluded.

Companions: b2b3fbc (Windows busy-file retries), 691bc8d (engine-anchor capture), and 92798ae, c1e55e2, 715c610, 689cfc8, 86bc89e (independent update/Doctor/recovery changes) are not applicable prerequisites.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 9cddca652a500d238e7222ef122330327c40108d)
RomneyDa added a commit that referenced this pull request Nov 12, 2026
Adapted from main commits 81fc267 and 000542f. Preserve complete inventory refusal and child-process lock isolation; retry slow batches by bisection and retain the manual first-hop guidance.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 00920b89cf3a97dc2db9041e9be43f55fd553307)
maplel pushed a commit to maplel/openclaw that referenced this pull request Nov 24, 2026
…aw#194058)

Failed-update triage now captures the operator's environment before managed candidate admission, so a coding agent installed only on the operator's PATH is still offered when the Gateway service's PATH differs. Restores the operator-environment contract from openclaw#134490 and keeps the launch confirmation from openclaw#143139.

Proof: shipped CLI on isolated Linux (Crabbox) with a running systemd Gateway: accept launches the operator-only agent, decline starts nothing, base 18bee8e reports no agent found; published 2026.11.1 upgrades to the fix with settings intact.

Co-authored-by: TorstenW <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: steipete <[email protected]>

(cherry picked from commit 7c702c3)

Release adaptation: Capture invoking operator env before candidate admission, forward to interactive triage only; preserve latest target selectors, confirmation and lease cleanup ordering. Exact three authorized production paths plus real lifecycle regression.

Follow-up dispositions: ad4863d fix: preserve the running installation when an agent updates its Gateway (openclaw#201570); dc73ec0 fix: let updates finish when another tool briefly reads OpenClaw's databases (openclaw#202541); d07b530 fix: clarify PostgreSQL schema upgrades for Git installs (openclaw#202098); e60ea9f test(update): add a Git release upgrade-survivor scenario (openclaw#201956); 2ef6f7b fix(update): build and serve Git releases outside node_modules (openclaw#201917); dbc1aa0 fix: keep the openclaw command and Gateway working after updating a pnpm install (openclaw#201735); f5e7641 fix: Git checkout updates across a schema change no longer end as post-update-failed after the new release starts (openclaw#201600); 2183caf fix: Git checkout updates no longer fail before the new release starts on a schema change or a busy database (openclaw#201463); 47e8649 fix: explain why Doctor cannot restore a scheduled job’s account (openclaw#201550); 8f2cfd4 fix: remove updater-only restrictions from agent maintenance guidance; cb5cfb2 fix: keep a doubtful killed-update recovery on the repair path (openclaw#201361); 24cb734 fix: keep carried-over scheduled jobs running after updates (openclaw#200653); d1276e1 feat(doctor): check OpenClaw ID member roles and honor an optional roles default (openclaw#197785); 0a39956 fix: finish updates when another tool reads OpenClaw's databases during the update (openclaw#201330); ea1c9d5 fix(update): settle remounted package publications before admission (openclaw#201336); 66b5212 fix(update): isolate malformed retained-install markers (openclaw#201199); 7e79c83 fix: let the next update finish a killed source checkout update (openclaw#201009); d905d8a fix: let the next update finish a killed update after the machine restarted (openclaw#200994); fdf0c95 fix: let the next update finish a killed update that had already installed the new version (openclaw#200866); 0c19bcd chore(release): close out 2026.11.5 on main (openclaw#200577); a1940e0 fix(matrix): keep explicit recovery available during deferred migration (openclaw#200805); 18b4776 improve: explain package baseline drift during updates (openclaw#200802); 1ad4cad fix(doctor): reclaim macOS updater runtimes blocked by non-updater processes (openclaw#200732); 427c857 fix: keep one missing archived transcript from blocking every update (openclaw#200733); 802e3f7 fix(update): keep valid cold archives from blocking updates (openclaw#200659); 23fca1a fix: let the next update continue after a killed update when nothing is left to repair (openclaw#200680); 3afe212 fix: let Doctor publish unchanged plugin migrations in any order (openclaw#200658); f65e4db fix(doctor): reclaim runtimes blocked by unrelated Linux processes (openclaw#200657); dab086c fix(update): let candidate Doctor read plugin dependencies from the staged package (openclaw#200595); 3447bee fix(update): keep updates going when the predecessor writes during its stop (openclaw#200569); 0ce9c77 fix: let the next update settle a package publication that a killed update left behind (openclaw#200550); ae31ea3 fix(update): repair handoffs in the journal-pinned lease store (openclaw#200532); 74020ea fix: continue updates when initial SQLite capture is stale (openclaw#200328); 6747b1e feat(update): run Git checkout installs from releases behind the release link (openclaw#199706); e3f8a67 fix(state): keep completed retained agent stores out of startup upgrade (openclaw#200284); 3c512c5 fix(gateway): move managed update lease operations off the main thread (openclaw#200169); ea69fcb chore(release): close out 2026.11.4 on main (openclaw#199956); 618bf31 fix(state): bound startup upgrade copies and pruning to owned state (openclaw#199929); e4a3093 perf(update): replace the candidate canary with a runtime contract check (openclaw#198268); 5dbf569 fix(update): plugin failures never fail an update or Gateway health; 764761e fix(update): refuse missing host prerequisites in one line and record a cause per attempt; 4c4fef4 fix(ui): update dialog claims installation before progress is confirmed (openclaw#199254); 136e1f6 fix(update): retrying an update from a dev checkout is refused after a killed update (openclaw#198673); 3bd03da fix(update): avoid duplicate database copies while the Gateway is stopped (openclaw#198148); 68a839b fix: isolate held agent databases until explicit restoration (openclaw#198180); e333f7e chore(ci): drop retired test-lines allocation records (3/3) (openclaw#197657); fd6fa47 fix: converge Gateway updates with environment-only service overrides (openclaw#196371); 7cf5e75 fix: clarify split-install updates and blocked Doctor repairs (openclaw#196342); 6ff8c86 fix(update): retain lazy sqlite catalog generation (openclaw#197095); 930e1f7 fix: keep stable updates and recovery free of premature migrations (openclaw#196474); a15f737 fix: preserve external plugin data during update rehearsal (openclaw#196301); 92798ae fix: updates survive interrupted heartbeat runs (openclaw#195656); c1e55e2 fix(update): restore LaunchAgent registration after repair contention (openclaw#195406); 715c610 fix(doctor): repair retained ISO session end timestamps (openclaw#194685); 689cfc8 fix(update): reclaim dead closing triage repair leases (openclaw#194503); 86bc89e fix(doctor): keep standing Codex parameter advice out of retirement blockers (openclaw#193650); 691bc8d fix(backup): read the backup engine without copying the live database (openclaw#194234); 000542f fix(backup): backups and updates fail on slow storage when a header probe batch misses its deadline (openclaw#194239); 31a65d5 fix(update): skip --no-lazy-fetch on Git versions without it (openclaw#194198); e45e99d fix(update): preserve dev update sources in tag-only Git clones (openclaw#193109)

Validation: Baseline2 intended operator-agent failures/32 controls passed; candidate34/34passed (194058-green.log). Accept launches synthetic operator-only CLI with expected env, decline starts nothing. Isolated updater flow, not live systemd/upgrade qualification.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 6689fd575ada8fe40a9593784deac18ec73041cd)
(cherry picked from commit 92e7a9fa223b0dc35801f25f70be90b472d9a6b7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. docs Improvements or additions to documentation size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant