Repository navigation
perf(main): gate idle git-common polling + coarse-FS add/remove fix (re-open of #9882) - #10074
Conversation
Co-authored-by: Orca <[email protected]>
…FS add/remove The worktrees-dir readdir was gated on the dir's mtime:ctime:ino:size signature, so on a coarse-mtime/FAT filesystem a same-granule add+remove (all four fields collide) went undetected until the ~30s index backstop. A single readdir of a small dir is negligible next to the per-entry structural stats that already run every tick, so always enumerate — the listing is the authoritative add/remove signal. The expensive per-entry index read stays gated on each entry's own dir signature; onFullScan now reflects the ungated index-metadata backstop fan-out (the real periodic cost) rather than the readdir. Co-authored-by: Orca <[email protected]>
…on readdir failure Follow-up to always-enumerating the worktrees dir: the readdir catch-all treated ANY error as an authoritative empty listing, so a transient failure (EIO/ESTALE/EMFILE, network/SSH hiccup) emitted a false delete for every linked worktree (and a false create next tick) — and enumerating every tick widened that exposure. Only ENOENT (dir truly absent) now yields an empty listing; other errors retain the known entries so per-entry stats still run and a real removal surfaces as that entry's own stat miss. Adds a regression test (readdir → ENOTDIR) asserting no false delete. Co-authored-by: Orca <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughLinked worktree polling now uses size-aware filesystem signatures, polls ✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…re-open of stablyai#9882) (stablyai#10074) * perf(main): gate idle git-common polling Co-authored-by: Orca <[email protected]> * fix(main): enumerate git-common worktrees every tick to catch coarse-FS add/remove The worktrees-dir readdir was gated on the dir's mtime:ctime:ino:size signature, so on a coarse-mtime/FAT filesystem a same-granule add+remove (all four fields collide) went undetected until the ~30s index backstop. A single readdir of a small dir is negligible next to the per-entry structural stats that already run every tick, so always enumerate — the listing is the authoritative add/remove signal. The expensive per-entry index read stays gated on each entry's own dir signature; onFullScan now reflects the ungated index-metadata backstop fan-out (the real periodic cost) rather than the readdir. Co-authored-by: Orca <[email protected]> * fix(main): don't fabricate worktree deletions on a transient git-common readdir failure Follow-up to always-enumerating the worktrees dir: the readdir catch-all treated ANY error as an authoritative empty listing, so a transient failure (EIO/ESTALE/EMFILE, network/SSH hiccup) emitted a false delete for every linked worktree (and a false create next tick) — and enumerating every tick widened that exposure. Only ENOENT (dir truly absent) now yields an empty listing; other errors retain the known entries so per-entry stats still run and a real removal surfaces as that entry's own stat miss. Adds a regression test (readdir → ENOTDIR) asserting no false delete. Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Orca <[email protected]>
Re-opens #9882 (auto-closed when its stacked base #9849 merged + branch was deleted). Contains only #9882's changes, cleanly rebased onto main (which now has #9849). Adversarial gpt-5.6-sol-xhigh re-review CLEAN. Includes the two review fixes: (1) always-enumerate the worktrees dir to catch coarse-FS same-granule add/remove, (2) ENOENT-vs-transient readdir error handling so a transient failure can't fabricate worktree deletions. Verified: git-common tests 35/35, typecheck:node clean.
Made with Orca 🐋