Repository navigation
fix(storage): defer WAL timers during owned offline maintenance - #167048
roboclaw-bot wants to merge 21 commits into
Conversation
Pause periodic admission on the local maintenance owner, retain cancellation joins, and summarize reader contention without hiding storage failures. Co-authored-by: RomneyDa <[email protected]>
|
🦞👀 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: needs changes before merge. What this changesThis PR pauses shared-state WAL timers behind locally owned offline maintenance and condenses repeated checkpoint diagnostics. Example: A 10-second shared-state checkpoint tick fires while the same process owns offline maintenance.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR: it addresses a concrete scheduling defect still present on main, and review found no introduced correctness bug. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherShared-state database handles use the WAL scheduler to request checkpoints and reclamation; state ownership controls admission, and checkpoint observations feed logs, status, and Doctor. flowchart TD
A[WAL timer] --> B[Maintenance scheduler]
B --> C[Local state owner]
C --> D[Wait for release or cancellation]
B --> E[Worker admission]
E --> F[SQLite maintenance]
F --> G[Checkpoint health]
G --> H[Logs and status]
Technical reviewBest possible solution: Retain the existing WAL and state owners while deferring optional local timer work until maintenance releases custody. Do we have a high-confidence way to reproduce the issue? Current-main source permits periodic work to encounter its own offline-maintenance refusal, and the supplied regression evidence reports error/warning results before the change; this read-only review ran no target code. Is this the best way to solve the issue? The change fixes admission at the existing scheduling owner, preserves explicit checkpoint authority, and correctly keeps cross-thread Doctor resource drainage outside its scope. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 48588a652222. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +127, Tests +114, Docs +14, Other +1. Total +256 across 13 files. Added test files: 0. View PR surface stats
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 HistoryReview history (3 earlier review cycles)Reviewed October 10, 2026, 5:25 PM ET / 21:25 UTC (Revision 4). |
Restore the wrapper runtime closure after the maintenance-owner extraction. Co-authored-by: RomneyDa <[email protected]>
Resolve the checkpoint test import conflict while retaining main cadence and native schema-admission changes. Preserve both source-owned test contracts. Co-authored-by: RomneyDa <[email protected]>
Preserve worker suspension, parked checkpoint ticks, engine-neutral admission, and current ownership checks while retaining local typed deferral and compact contention diagnostics. Keep retired WAL probes and projection timestamps removed. Co-authored-by: RomneyDa <[email protected]>
Merge pinned main 2f22858 to include the scheduled-message auth correction and current storage/runtime inputs. Preserve the reviewed WAL deferral and bounded diagnostics delta. Co-authored-by: RomneyDa <[email protected]>
Record the observed 452 production environment names without changing the source inventory or relaxing the growth guard. Co-authored-by: RomneyDa <[email protected]>
Replace the dense deferral description with three plain sentences and distinguish detailed WAL health from compact warning logs. Preserve surrounding documentation and runtime behavior. Co-authored-by: RomneyDa <[email protected]>
Recheck unowned database state under the native writer lock, preserve foreign-key policy around settlement, and publish creation facts only after commit. Co-authored-by: RomneyDa <[email protected]>
Preserve offline deferral and compact diagnostics alongside current scheduler, native identity, cleanup custody, and admission snapshot owners. Co-authored-by: RomneyDa <[email protected]>
Preserve cold-claim transaction and WAL deferral behavior while adopting the pinned schema-refresh and PostgreSQL owner split. Keep the complete runtime wrapper inventory. Co-authored-by: RomneyDa <[email protected]>
Worked on by: - @RomneyDa Co-authored-by: RomneyDa <[email protected]> OpenClaw-Publication: d6b7ee66-87c6-4a26-a6b1-64bca28d97f2
Refresh schema facts under the cold-claim writer lock without revoking physical integrity proof. Keep ownership, version, foreign-key and commit-authority checks intact. Register the extracted native storage migration with its existing Kysely owner group and extend the existing close/reopen regression to retain integrity evidence. Co-authored-by: RomneyDa <[email protected]>
Merge pinned tested base 5ce763a without rewriting WAL-maintenance history. Align the Darwin/Bun census, pristine SQLite catalog, and package fixture closure with the incoming contracts. Preserve real census exports in the synthetic mock, the cold-claim integrity repair, and the recorded inherited gate failures. Co-authored-by: RomneyDa <[email protected]>
Merge the frozen upstream composition while retaining optional WAL deferral, physical ownership checks, cancellation, and real storage-error reporting. Keep current schema admission and the shared process-inspection owners. Co-authored-by: RomneyDa <[email protected]>
Worked on by: - @RomneyDa Co-authored-by: RomneyDa <[email protected]> OpenClaw-Publication: bb69ec95-c654-42d7-9e2d-5e6f4882f08f
Merge canonical upstream 7df11be to resolve the inherited Bifrost auth parity failure while preserving WAL maintenance ownership changes. Keep loopback HTTP fixtures independent of ambient proxy configuration. Focused composition checks and fixture format/types/lint pass. Retain investigated inherited test-root budget failures; package and product proof remain pending. Co-authored-by: RomneyDa <[email protected]>
Worked on by: - @RomneyDa Co-authored-by: RomneyDa <[email protected]> OpenClaw-Publication: 3249356c-68c5-4cd9-88c6-438e04dbdb5f
Compare command children with canonical selected-owner metadata before changed-row coalescing. Preserve exact coverage and execution policies, including child environment, fallback-worker and memory limits. The original actual CI base reproduces the assertion failure; the repaired tested merge and current worktree each pass the full 41-case file. Co-authored-by: RomneyDa <[email protected]>
Worked on by: - @RomneyDa Co-authored-by: RomneyDa <[email protected]> OpenClaw-Publication: 3cc2b5c0-03cf-4004-b0f2-186937fbda46
Adopt the exact fixture from @steipete canonical commit 94e1fbf instead of retaining the independent local equivalent. Preserve every selected child and its config, worker and memory limits while comparing selected-owner policy. The canonical file passes all 41 cases on this worktree and the actual CI composition. No scheduler policy or dependency change is included. Co-authored-by: RomneyDa <[email protected]>
Worked on by: - @RomneyDa Co-authored-by: RomneyDa <[email protected]> OpenClaw-Publication: ecebd66a-2130-48b3-af60-be5f4e8343ae
Related: #166413, #170022
What Problem This Solves
Fixes repeated lock-refusal warnings when background SQLite maintenance runs during the same process's offline work.
User Impact
Maintenance waits for offline work or cancellation. Reader/busy warnings stay compact; real errors remain visible. Explicit checkpoint authority is unchanged. No WAL-related migration or schema, format, permission, retention or durability change. Installed-update acceptance is pending.
Why This Change Was Made
Timers defer to their verified local maintenance owner. Release resumes the existing cadence without polling; cancellation and ownership loss stay distinct. Detailed WAL health remains separate from compact logs.
Upstream owns creation locking, schema facts, Darwin inspection and the benchmark catalog; superseded local migration code is removed. Canonical 7df fixed Bifrost parity. Its HTTP fixture scopes/restores both NO_PROXY spellings; production proxy/auth policy is unchanged.
Evidence
1c208c54e10a39fc90cdb6d4b62e27ad8811607b, tree2cd47891d48793fc465325c0e9c799c207267a08, parent 016dcab. Published780fe85315e3429586297696aabd0c07286fdb17is its same-tree marker child; request ecebd66a-2130-48b3-af60-be5f4e8343ae. Exact @steipete canonical 94e1 fixture, blob 8e849e2a1e666994631ada36603e7b274165fad5. Only this test changed; hooks passed, checkout clean, no main/scheduler/dependency change.67c878f2069a6cfa3bbc688af51cc63c4761123572a84d59ba9abd87e69b984e; 120,037,759 bytes/20,409 entries. Build ID 2026.10.5-780fe85315e3-2026-10-21T11-11-51.054Z. Public install.sh/npm 12.2.0 installed these exact bytes in isolated home/prefix/cache; native binding, version/help and 17,926 content hashes passed. Installed 46,346 entries/543.5MiB, below 47,500/900MiB budgets. Package 535.957s (build 191.4s), install 16.547s. Six roots/42 native claims joined; source/index/dependencies and temporary package edits restored.Retained failures and historical evidence
Local validation retains
tests.result: failand investigated failures. On frozen 7df, changed-test roots were agents-tools 721/720, gateway-root 724/720, infra 727/720 and plugins-platform 728/720; all 212 configurations/counters/membership matched upstream. The 29 fallback compiler passes did not qualify the boundary or consumer narrowing.At cbfaa0d, 11/14 static commands passed. Failed root counts 721/723/727 exceeded 720 with 207 matching configurations. Incoming max-lines suppressions in
ui/src/pages/chat/components/chat-message.test.tsx,ui/src/pages/config/config-page-state.tsandui/src/pages/sessions/sessions-page-state.tswere missing from the baseline. The standalone environment guard reported 459/452; its nested check had short-circuited. Eight changed production files and remaining inputs were incoming-exact. Older 453/452 is another composition. No cap, baseline, suppression, severity override or waiver was used; old guards were not rerun or declared fixed.The first local proof attempt added eight discovery failures because synthetic non-Git fixtures were beneath a Git checkout. Normal external temporary ownership removed them while preserving the target RED. The attempt remains recorded; assertions were not weakened.
Prior CI 38900010210 failed on aeb5a23 through e9b84bd1 / base 5ce763a: 92 passed, 14 underlying failures plus gate, 23 skipped. Integrity-proof/inventory repairs converged onto upstream owners; later secondary-ownership success still has no proven cause. Other failures are not blanket-fixed.
The older concurrent-claim failure and red/green evidence remain historical. Run 38796748726 passed on 42ef154, not this candidate. The last fully read ClawSweeper comment reviews 16cf632: no findings, historical conflict hold and installed-entry-point gap. No current-head formal review or merge/auto-merge request.
Requested and co-authored by @RomneyDa.
Work sessions
View the OpenClaw team session