Repository navigation
#92134: fix(memory-wiki): retry transient path-alias errors during source page write - #92375
zhangqueping wants to merge 2 commits into
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: the newer open PR at #94443 targets the same memory-wiki race, retries the observed Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Close this branch and let maintainers review one canonical memory-wiki fix that retries only transient So I’m closing this here and keeping the remaining discussion on #94443. Review detailsBest possible solution: Close this branch and let maintainers review one canonical memory-wiki fix that retries only transient Do we have a high-confidence way to reproduce the issue? Yes at source level: current Is this the best way to solve the issue? No. Retrying Security review: Security review cleared: The diff adds no dependency, workflow, secret, permission, or broad file-access surface; the security-sensitive fs-safe guard failures still rethrow after the attempted retry path. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 01e562113b31. |
…e write (openclaw#92134) Concurrent bridge re-exports use atomic rename to replace source pages. When wiki_status runs during a re-export burst, the openPinnedFileSync guard sees the rename as a path-alias error. Add bounded retry (3 attempts with 10ms/20ms/30ms backoff) before the existing FsSafeError handling. Closes openclaw#92134
a70c59f to
c544c1b
Compare
…as Error | undefined
|
ClawSweeper applied the proposed close for this PR.
|
Summary
Fix
wiki_statusintermittently aborting with "Refusing to write imported source page through symlink" when the memory-wiki bridge concurrently replaces source pages via atomic rename.Root Cause
Concurrent bridge re-exports use atomic temp-write-then-rename to replace source pages. When
wiki_statusruns during a re-export burst,vault.write()internally callsopenPinnedFileSyncwhich detects the rename as apath-aliaserror (transient race, not security). This error was thrown immediately, aborting the entirewiki_statuscall.Fix
Add a bounded retry loop for
FsSafeErrorwithcode === "path-alias"before the existing error handling: 3 attempts with 10ms/20ms/30ms backoff. Only retries onpath-alias; genuinesymlink/hardlink validation failures still hard-fail.Fixes #92134
Real behavior proof
Behavior addressed:
When
vault.write()fails withFsSafeErrorcodepath-alias(transient rename race), retry up to 3 times with progressive backoff before surfacing the error.Real environment tested:
Linux 4.19.112-2.el8.x86_64, Node.js v24.13.1, pnpm, vitest 4.1.7
Exact steps or command run after this patch:
After-fix evidence:
Observed result after the fix:
All 11 memory-wiki tests pass. The retry loop correctly handles transient
path-aliaserrors (up to 3 attempts, 10ms/20ms backoff) whilesymlinkand otherFsSafeErrorcodes still hard-fail immediately. Lint passes without errors.What was not tested:
Live concurrent bridge re-export race condition reproduction (requires running gateway with active memory-wiki bridge under re-export load).
Regression Test Plan
node scripts/run-vitest.mjs extensions/memory-wiki/src/source-page-shared.test.tspassesnode scripts/run-vitest.mjs extensions/memory-wiki/src/bridge.test.tspassessymlinkerrors still hard-fail immediately (no retry)writeErrorproperly typed asError | undefined(noonly-throw-errorlint violations)AI-assisted: built with Claude Code