Repository navigation
fix: avoid Doctor and Gateway failures during NFS snapshot cleanup - #195409
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: needs maintainer review before merge. What this changesThis PR closes verified snapshot handles before staging cleanup and defers temporary-file cleanup failures without discarding successful backups or schema reads. Example: Doctor creates a verified SQLite backup on NFS, but removing its temporary directory returns ENOTEMPTY.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a concrete released NFS failure, and source review found no discrete introduced correctness defect. Priority: P1 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherDoctor, updates, and Gateway preflight use shared SQLite snapshot owners to turn admitted database files into verified private images; publication returns verified backups while cleanup owners retain responsibility for temporary files. flowchart TD
A[Doctor and Gateway] --> B[Snapshot acquisition]
B --> C[Integrity and content verification]
C --> D[Exclusive publication]
D --> E[Verified backup or read result]
D --> F[Temporary cleanup owner]
F --> G[Warning and deferred retry]
Technical reviewBest possible solution: Keep the repair in the existing snapshot publication and cleanup owners while preserving verification, private permissions, and retirement custody. Do we have a high-confidence way to reproduce the issue? The reporter supplies a specific released-version NFS reproduction, and current main contains matching cleanup ordering and fatal cleanup paths; this read-only review did not execute the product or reproduce native NFS behavior. Is this the best way to solve the issue? The patch is a focused repair using existing owners: close the verified handle before directory removal, retain cleanup custody after recoverable removal failures, and preserve original read and verification failures. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 98fad049dcae. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +28, Tests +86, Docs +1, Other +2. Total +117 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:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 8, 2026, 4:37 PM ET / 21:37 UTC. |
24da1be to
97e222d
Compare
97e222d to
a9f06f7
Compare
a9f06f7 to
7248c5c
Compare
…penclaw#195409) * fix: tolerate NFS SQLite snapshot cleanup * test: allow deferred NFS cleanup in discovery custody * fix: defer only retired NFS snapshot removal errors * fix: keep candidate snapshot cleanup best effort * test: allocate inherited main test-line debt --------- Co-authored-by: roboclaw-bot <[email protected]>
Required minimal dependency of P1 NFS fix #195409. Preserve beta.4's SqliteSnapshotCleanupError import while adding withPreparedSqliteSnapshot. Focused cleanup regression: 2 passed; targeted lint/format and diff check passed. (cherry picked from commit 38cfa9e) Co-authored-by: RomneyDa <[email protected]>
…195409) Adapt the canonical repair to beta.4: retain its token/native-close lifecycle, move the shared cleanup error to its existing lifecycle owner, and migrate all internal imports. Use existing registerSqliteCacheExitClose for the ordered best-effort exit retry instead of importing the broad #191842 migration. Preserve PostgreSQL and read-only contracts. Omit main-only base-debt allocation. Fixture adaptation: private ancestors and canonical staging-root resolution keep injected cleanup failures inside the test fixture under umask 0002. Baseline NFS publication regression failed; repaired staging transport, publication, cleanup, custody, and update-worker regressions pass. (cherry picked from commit 7c7a4d5) Co-authored-by: RomneyDa <[email protected]>
Remove two redundant compaction casts and its now-stale max-lines allowance. Compare encoded cleanup paths so the Windows regression checks actual JSON logs. Evaluate the macOS package matrix for diagnostic and release-gate requests instead of retaining the pre-backport static-matrix expectation. These are focused adaptations of #199561, #195409 and #198989, diagnosed by stable-profile FRV 43794859705 on the frozen beta.4-based candidate. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Fixes Doctor and Gateway startup failures when NFS leaves busy SQLite snapshot cleanup directories behind, while preserving best-effort candidate update checks.
Fixes #195396.
User Impact
Verified snapshots can finish with a cleanup warning when NFS retains a busy directory. Doctor/Gateway preflight and strict snapshot callers still surface genuine cleanup failures. Candidate checks log cleanup hiccups separately, preserving their successful result or original read error.
Why This Change Was Made
Close the published target before removing staging. Recognize regular
.nfs*aliases and defer only classified final-removalEBUSY/ENOTEMPTYafter private snapshot retirement. Keep identity, content, integrity, publication, and backup validation intact.Candidate shared-state reads, isolated rehearsal source cleanup, and their parent schema inspection staging explicitly select warning-only cleanup. The shared parent helper remains strict for Doctor callers; unconfirmed worker termination still fails and retains staging. A warning never claims that cleanup or retirement succeeded.
Evidence
ac26a0d7f1f8. GitHub's compare API confirms it contains3fa60aed3456, the fix for the inherited legacy refusal-notice TS2345. All four existing code/test patches are identical through rebase; the refresh commit adds only an inherited-debt allocation record.pe4-195409-base-debt.txt, labeled as inherited main debt, funds exactly 19. Final CI-equivalent merge-index ratchet passes: 6,586,956 / 6,586,956; zero slack. Whitespace checks pass.7248c5cfe5fdwith a lease pinned toa9f06f77b986. Published-head checks are pending, with no failures reported in the initial read. No merge or auto-merge is requested.