Skip to content

feat: consolidate paths further more for fsevents backend if needed#91

Merged
sapphi-red merged 1 commit into
mainfrom
feat/consolidate-paths-further-more-if-needed
May 19, 2026
Merged

feat: consolidate paths further more for fsevents backend if needed#91
sapphi-red merged 1 commit into
mainfrom
feat/consolidate-paths-further-more-if-needed

Conversation

@sapphi-red

@sapphi-red sapphi-red commented May 19, 2026

Copy link
Copy Markdown
Member

On macOS, the default file descriptor soft limit is 256. When watching many individual paths via FSEvents, the process can run out of file descriptors, causing spawn EBADF errors when spawning child processes.

This PR adds a max_fsevent_paths option (default 128) to ConsolidatingPathTrie. When the number of watched paths exceeds this limit, the trie automatically consolidates bottom-up — replacing the deepest individual paths with their parent directories — until the count is under the limit. Distinct subtrees are never merged (e.g. /a/... and /b/... won't consolidate to /).

Event routing is unaffected and the callback already filters against the original watch set.

// Default: 128 (stays under macOS default fd limit of 256)
Config::default()

// Custom limit
Config::default().with_max_fsevent_paths(512)

// Disable consolidation
Config::default().with_max_fsevent_paths(0)

@sapphi-red sapphi-red marked this pull request as ready for review May 19, 2026 09:55
@sapphi-red sapphi-red merged commit 5a4636c into main May 19, 2026
12 checks passed
@sapphi-red sapphi-red deleted the feat/consolidate-paths-further-more-if-needed branch May 19, 2026 09:56
@rolldown-guard rolldown-guard Bot mentioned this pull request May 19, 2026
sapphi-red pushed a commit that referenced this pull request May 20, 2026
## 🤖 New release

* `rolldown-notify`: 10.3.1 -> 10.4.0 (✓ API compatible changes)
* `rolldown-notify-debouncer-mini`: 0.8.7 -> 0.8.8
* `rolldown-notify-debouncer-full`: 0.7.7 -> 0.7.8

<details><summary><i><b>Changelog</b></i></summary><p>

## `rolldown-notify`

<blockquote>

##
[10.4.0](rolldown-notify-v10.3.1...rolldown-notify-v10.4.0)
- 2026-05-20

### Added

- consolidate paths further more for fsevents backend if needed
([#91](#91))

### Other

- consolidate watch paths via `ConsolidatingPathTrie` on Windows
([#93](#93))
- batch path changes via `PathsMut` on Windows
([#94](#94))
</blockquote>

## `rolldown-notify-debouncer-mini`

<blockquote>

##
[0.8.8](rolldown-notify-debouncer-mini-v0.8.7...rolldown-notify-debouncer-mini-v0.8.8)
- 2026-05-20

### Other

- updated the following local packages: rolldown-notify
</blockquote>

## `rolldown-notify-debouncer-full`

<blockquote>

##
[0.7.8](rolldown-notify-debouncer-full-v0.7.7...rolldown-notify-debouncer-full-v0.7.8)
- 2026-05-20

### Other

- updated the following local packages: rolldown-notify
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).

Co-authored-by: rolldown-guard[bot] <278280044+rolldown-guard[bot]@users.noreply.github.com>
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.

1 participant