Repository navigation
fix(pi-fff): dedup concurrent aux finders and bound grep time (#746) - #750
Merged
Merged
Conversation
Concurrent AuxFinderPool.acquire() calls for the same root each started a full scan because entries was populated only after waitForScan() resolved. Coalesce in-flight creations by root via a pending map. Also pass a finite timeBudgetMs to native grep (sync call, uninterruptible by AbortSignal) and skip the fuzzy fallback when the exact pass left a nextCursor. Refs #746
dmtrKovalenko
approved these changes
Aug 5, 2026
Co-authored-by: Dmitriy Kovalenko <dmitriy@iusevimbtw.com>
abhijit-s
pushed a commit
to abhijit-s/fff
that referenced
this pull request
Aug 6, 2026
Upstream: empty-dir scan (dmtrKovalenko#735), gitignore fix (dmtrKovalenko#744), pi-fff aux dedup (dmtrKovalenko#750). Conflict resolution: - file_picker.rs: keep fork's ignore_globs/user_gi filter atop upstream's sort - background_watcher.rs: merge fork's per-root ignore_globs/user_gi into upstream's walk_collect_files rewrite of index_new_directory (dmtrKovalenko#735); adopt upstream's clean Linux watch registration, dropping the fork's per-new-dir self-heal retry to avoid a picker->debouncer lock-order inversion. Primary self-heal (create_debouncer + coverage recheck) preserved.
abhijit-s
pushed a commit
to abhijit-s/fff
that referenced
this pull request
Aug 10, 2026
First stable release since 0.17.2. Rolls up the fork's Linux APT delivery pipeline, the worker bootstrap thundering-herd fix, the watcher lock-order hardening, the macOS git-status staleness fix, and three upstream syncs — empty-dir scan (dmtrKovalenko#735), gitignore fix (dmtrKovalenko#744), pi-fff dedup (dmtrKovalenko#750), and rescan throttling for giant folders (dmtrKovalenko#751).
wpenistone
pushed a commit
to wpenistone/fffork
that referenced
this pull request
Oct 13, 2026
…valenko#746) (dmtrKovalenko#750) * fix(pi-fff): dedup concurrent aux finders and bound grep time (dmtrKovalenko#746) Concurrent AuxFinderPool.acquire() calls for the same root each started a full scan because entries was populated only after waitForScan() resolved. Coalesce in-flight creations by root via a pending map. Also pass a finite timeBudgetMs to native grep (sync call, uninterruptible by AbortSignal) and skip the fuzzy fallback when the exact pass left a nextCursor. Refs dmtrKovalenko#746 * Apply suggestions from code review Co-authored-by: Dmitriy Kovalenko <dmitriy@iusevimbtw.com> * fix typo Co-authored-by: Dmitriy Kovalenko <dmitriy@iusevimbtw.com> --------- Co-authored-by: gustav-fff <286169375+gustav-fff@users.noreply.github.com> Co-authored-by: Dmitriy Kovalenko <dmitriy@iusevimbtw.com>
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.
Closes #746
Root cause
AuxFinderPool.acquire()pushes intoentriesonly afterwaitForScan()resolves (packages/pi-fff/src/aux-finders.ts:84), so two concurrentacquire("/Users/<user>")both observe emptyentriesand each spawn a separate full-home scan — no dedup, unlike the main finder'sfinderPromise. Separately,picker.grep()(packages/pi-fff/src/index.ts:708) was called with notimeBudgetMs; the native call is synchronous so anAbortSignalcannot interrupt an in-flight search, and the fuzzy fallback repeated the full traversal after an exhausted exact pass.Fix
Coalesce in-flight
AuxFinderPoolcreations by root through apendingmap so concurrent acquires share one finder/scan. Pass a finiteGREP_TIME_BUDGET_MS(10s) to both native grep calls (engine returns partial results +nextCursoron timeout). Skip the automatic fuzzy fallback when the exact pass left anextCursor(corpus not exhausted), avoiding a repeated broad-root walk.Steps to reproduce
On pre-fix
origin/main:Expected:
created.length === 1, one shared finder.Actual (pre-fix):
Two separate finders created for the same root → two concurrent full-home scans, matching the reported tens-of-minutes hang.
How verified
The regression test
two concurrent acquires for same root share one finderfails on pre-fixmainand passes with this change.Automated triage via Gustav. Honk-Honk 🪿