Skip to content

fix: bound list inspections to avoid descriptor exhaustion - #93

Merged
abruption merged 1 commit into
mainfrom
fix/87-bounded-list
Oct 4, 2026
Merged

abruption merged 1 commit into
mainfrom
fix/87-bounded-list

Conversation

@abruption

Copy link
Copy Markdown
Owner

Summary

list starts one inspection per thread, so a populated home can exhaust file descriptors during overlapping transcript traversals. Limit inspections to four workers, keep sorted result slots, stop dispatching after the first failure, and await already-started inspections before returning the original error.

Closes #87

Type

  • fix

Safety impact

Each thread retains independent before/after lock, owner, and transcript observations. No transcript index or safety evidence is shared between threads or observation windows. The inspect/unlock policy and signal revalidation paths are unchanged.

Validation

  • The actual CLI lists 120 synthetic sessions under an isolated descriptor limit of 256, returning complete sorted JSON.
  • Actual filesystem traversals, transcript reads, and native coordinated flock probes are retained. Synthetic ps/lsof output avoids unrelated process-table scans in this resource regression; the existing real-owner integration suite runs separately.
  • Instrumentation checks 480 independent root traversals, at most eight concurrent root traversals and 48 nested directory operations, and zero active traversals at completion.
  • An injected traversal failure preserves exit 3 and the structured command error, stops new dispatch, and drains active inspections.
  • Restoring the previous unbounded code in the generated test build produces an actual EMFILE CLI failure; the new regression fails against it and passes against this change.

Checklist

  • npm ci passes
  • npm run check passes
  • npm run lint passes
  • npm test passes: 175 tests, 174 passed, 1 filesystem-dependent skip
  • npm run smoke:package passes
  • Commits follow Conventional Commits
  • CLI resource and failure behavior is documented
  • No tokens, private paths, or unredacted process data are in the diff

Local validation used Node 24.16.0 on macOS arm64; the existing CI matrix checks Node 22/24 on macOS/Linux x64/arm64. Only generated fixture data was used.

@abruption abruption added this to the v0.4.3 milestone Oct 4, 2026
Comment thread test/list-concurrency.test.mjs Dismissed
@abruption
abruption merged commit 1ba3290 into main Oct 4, 2026
23 checks passed
@abruption
abruption deleted the fix/87-bounded-list branch October 4, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: bound list transcript scans to prevent file-descriptor exhaustion

2 participants