Repository navigation
fix(watch): do not block macOS entry watch on a FIFO - #830
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. Reviewed October 4, 2026, 10:43 PM ET / October 5, 2026, 02:43 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR makes macOS filesystem entry-watch registration nonblocking for FIFOs, adds a bounded regression covering FIFO registration and symlink replacement, and updates watch documentation and the changelog. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main and v0.23.0 still contain the blocking entry-open path. No introduced correctness or security defect was found. Priority: P2 Review scores
Verification
How this fits togetherfs-safe watches admitted paths beneath a trusted filesystem root. Its shared macOS watch hub opens identity-checked descriptors and converts kernel events into hints for guarded metadata scans. flowchart TD
A[Admitted root and entry] --> B[Shared macOS watch hub]
B --> C[Open entry without blocking]
C --> D{Identity still matches?}
D -->|No| E[Reject stale registration]
D -->|Yes| F[Register kernel watch]
F --> G[Hints for guarded scans]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep entry registration nonblocking while retaining descriptor confinement, identity rejection, and bounded real-filesystem regression coverage. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the path: registering an admitted FIFO reaches a potentially blocking openat on the shared macOS hub. This review did not execute a failing current-main reproduction. Is this the best way to solve the issue? Yes, adding O_NONBLOCK to both non-directory branches is a narrow repair that keeps the existing confinement and identity contract intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4c0a828bec29. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
Entry scopes opened the admitted name with O_EVTONLY and no O_NONBLOCK. A FIFO at that name blocked the hub thread in openat and froze every watcher. Non-directory entries now include O_NONBLOCK. Signed-off-by: Sebastien Tardif <[email protected]>
Native check on macos-15-intel failed in sidecar-contention root-async with not-found during acquire. The same job passed on macos-15. The FIFO registration passed on the intel runner. A fork cannot rerun that one job. Signed-off-by: Sebastien Tardif <[email protected]>
15c392d to
74d8b5d
Compare
Prepare `@openclaw/fs-safe` 0.23.1 from main, using the same 13-file scope as #826: root, native workspace, seven platform package versions, exact optional-dependency pins, and regenerated Cargo/pnpm lock entries. No implementation or dependency changes are included. Finalize the 2026-10-04 changelog with an empty Unreleased section above it. Highlights cover no-replace publication on gVisor/9p and other unsupported filesystems (#834, fixes #828), container-denied FICLONE fallback for single-file and tree copies (#829, #835), and nonblocking macOS FIFO watching (#830). The six fixes include PR links and contributor credit, including @Mohl and co-author @foxsky, @vishnukool, and @SebTardif. Validation: `pnpm build`, `pnpm check` (662 test files and 13,431 tests passed; 65 files and 4,108 tests skipped), `pnpm pack:check`, `node scripts/release-notes.mjs 0.23.1`, and `git diff --check` passed. The local build selected the installed rustup compiler explicitly because the default Homebrew Rust compiler could not see the WASM target. Codex autoreview is scoped-clean at P0–P2. Both generated lockfile diffs are limited to the intended version changes. Release publication remains exclusively through the signed v0.23.1 tag and release.yml trusted publishing. Exact-head CI passed on `26e42f21a6b568d3f6a37408dea6f3b89ccf10b3`: [CI](https://github.com/openclaw/fs-safe/actions/runs/37265555433), [coverage](https://github.com/openclaw/fs-safe/actions/runs/37265555421), [mutation proofs](https://github.com/openclaw/fs-safe/actions/runs/37265555402), [benchmarks](https://github.com/openclaw/fs-safe/actions/runs/37265555459), and [CodeQL](https://github.com/openclaw/fs-safe/actions/runs/37265555471). No runner reruns or failure exceptions were needed. Main remained at `04e370a3e39eb6e98e6cb54877a5941b6d688cde` before merge.
A FIFO at an admitted macOS entry name could block
openaton the shared watch hub and freeze every watcher. Entry targets now useO_NONBLOCKfor ordinary entries and symlinks:O_SYMLINKcan also open a FIFO that replaces an admitted symlink, so its identity check must remain reachable. Directory opens retainO_DIRECTORY.The regression runs in a bounded child process, verifies direct FIFO registration, and verifies that a symlink replaced by a FIFO returns
ESTALE. On timeout the parent kills and reaps the child. Adjacent watch and scan paths use directory-only opens or metadata calls; no additional unguarded leaf open was found. The watch documentation and Unreleased changelog describe the fix.Validation:
cargo test --workspace --lockedpassed (145 native tests plus archive tests);cargo clippy --workspace --locked -- -D warningspassed; Codex autoreview is clean at P0–P2. Fullpnpm checkpassed lint, build, allocator-build, and documentation checks locally, but the full test phase was stopped after widespread timing failures on a busy host; exact-head hosted CI is the cross-platform gate.Thanks @SebTardif for the fix and regression.
Exact-head CI passed on
74d8b5de89e37cadb5973eea53cf411523f9ce0b: all OS lanes, coverage, benchmarks, watch ancestor proofs, and CodeQL. CI run.