-
Notifications
You must be signed in to change notification settings - Fork 40
Glob tool hangs indefinitely on broad directory patterns #636
Copy link
Copy link
Closed
Description
Description
When running from the home directory, calling Glob "**/dbt_project.yml" hangs indefinitely (1+ hours with no response). The recursive glob pattern scans the entire filesystem tree from the home directory without any timeout or scope limit.
Reported by user FrankTub in #623 (external report).
Root Cause
Ripgrep.files() is spawned with --files --hidden from a broad directory with no timeout. The --hidden flag makes it worse (scans .cache, .npm, .local, etc.). Home directory isn't a git repo, so no .gitignore helps.
Fix
- Add a 30-second timeout using
abortAfterutility - Return partial results on timeout with a helpful message guiding users to narrow their search
- Kill the
rgchild process immediately on early exit (100-file limit or timeout) vialocalAbortcontroller - Properly distinguish timeout errors from real errors (ENOENT, permissions) — only swallow
AbortErrorfrom timeout signal
Upstream Context
Upstream has related issues (#18954 infinite loops, #5220 100% CPU) but no merged fixes yet.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels