Repository navigation
Conversation
Close retained SQLite snapshot owners during normal CLI teardown so one-shot state reads do not leave staged copies behind. Fixes openclaw#157712
Contributor
|
🦞👀 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. |
Contributor
|
Codex review: stale review; fresh review needed. Summary Next step Review history (1 earlier review cycle)
|
steipete
added a commit
that referenced
this pull request
Nov 2, 2026
Reserve private state admission for a genuinely hot rollback journal during startup, then recover the canonical database only after ownership and config guards pass. Normal startup and runtime readers keep using live SQLite. Remove Gateway legacy snapshot scanning. Drain active snapshot payloads with async bounded truncation and retain producer custody through reply delivery and parent exit. Integrate the one-shot CLI drain from #178730. Co-authored-by: Frosmans <[email protected]>
steipete
added a commit
that referenced
this pull request
Nov 2, 2026
* fix: prevent large-database Gateway startup and cleanup stalls * fix: preserve observation policy for live state reads * fix: preserve crash restart without routine state snapshots Reserve private state admission for a genuinely hot rollback journal during startup, then recover the canonical database only after ownership and config guards pass. Normal startup and runtime readers keep using live SQLite. Remove Gateway legacy snapshot scanning. Drain active snapshot payloads with async bounded truncation and retain producer custody through reply delivery and parent exit. Integrate the one-shot CLI drain from #178730. Co-authored-by: Frosmans <[email protected]> * fix: avoid agent startup copies and preserve snapshot handoff Permit native closed-WAL inspection under the existing Gateway live-read policy while retaining full integrity checks and offline artifact preservation. Release producer staging locks before result publication while keeping cleanup custody through delivery. Prove both regressions at their owning boundaries, repair callback fixtures, and isolate the PostgreSQL orphan-inventory test from sibling schema cleanup. The actual cleanup owner took 57.8 seconds to drain a synthetic 35 GiB clone, so avoiding the unnecessary agent copy removes that admission work. --------- Co-authored-by: Frosmans <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 3, 2026
…aw#190918) * fix: prevent large-database Gateway startup and cleanup stalls * fix: preserve observation policy for live state reads * fix: preserve crash restart without routine state snapshots Reserve private state admission for a genuinely hot rollback journal during startup, then recover the canonical database only after ownership and config guards pass. Normal startup and runtime readers keep using live SQLite. Remove Gateway legacy snapshot scanning. Drain active snapshot payloads with async bounded truncation and retain producer custody through reply delivery and parent exit. Integrate the one-shot CLI drain from openclaw#178730. Co-authored-by: Frosmans <[email protected]> * fix: avoid agent startup copies and preserve snapshot handoff Permit native closed-WAL inspection under the existing Gateway live-read policy while retaining full integrity checks and offline artifact preservation. Release producer staging locks before result publication while keeping cleanup custody through delivery. Prove both regressions at their owning boundaries, repair callback fixtures, and isolate the PostgreSQL orphan-inventory test from sibling schema cleanup. The actual cleanup owner took 57.8 seconds to drain a synthetic 35 GiB clone, so avoiding the unnecessary agent copy removes that admission work. --------- Co-authored-by: Frosmans <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes one-shot CLI state reads retaining SQLite snapshot owners after the command finishes.
Fixes #157712.
User Impact
One-shot commands release their retained snapshot worker and private files before exiting. The source database remains unchanged. No configuration, schema or persistent-data migration is required.
Why This Change Was Made
Normal CLI resource finalization now invokes the existing asynchronous snapshot cleanup owner after database teardown. Signal-only cleanup and a synchronous process-exit hook cannot retire that owner safely.
This revision integrates current main to resolve the actual merge conflict and replaces the mock-call assertion with a subprocess regression using a real SQLite database and the production snapshot worker. It introduces no new cleanup mechanism or retention policy.
Evidence
The new process regression passes with the fix: it reads value 42 through a real retained snapshot, exits successfully, removes the snapshot directory and preserves the source bytes.
Negative control with only the snapshot finalizer removed: the same subprocess fails its 20-second completion bound because the retained owner prevents exit.
CLI finalization suites: 10/10 passed. Existing SQLite cleanup/native-owner suites: 21/21 passed.
Focused config/CLI typecheck, targeted formatting/lint and
git diff --check: passed.Changed process-test file: 6/6 passed, 3.86 seconds Vitest duration and 4.77 seconds wrapper wall time. Hosted CI time is not yet available for this revision.
The previous
mock-exportsCI failure was inherited from the frozen upstream base, not this patch. Upstream fixed it in2466488c29e25f6fdafe0d6419387116e4194ade; no unrelated doctor-test repair or blind rerun is included here.Local autoreview assessed the complete staged candidate against main
176c9c7496fd99c2cc1259bcb96e7d63fd84ef7cfor P0/P1/P2 defects: complete, no actionable findings. Review scope was the change and supplied CLI/snapshot source context, not a whole-repository audit. Hosted checks and maintainer review remain separate from local proof.