Skip to content

fsevents: Keep a stream running across watch/unwatch rebuilds - #9

Merged
SomeoneToIgnore merged 2 commits into
mainfrom
fsevents-resume-after-rebuild
Jul 21, 2026
Merged

fsevents: Keep a stream running across watch/unwatch rebuilds#9
SomeoneToIgnore merged 2 commits into
mainfrom
fsevents-resume-after-rebuild

Conversation

@SomeoneToIgnore

Copy link
Copy Markdown

Fixes hanging tests in Zed:
image

…and `watch`/`unwatch`/`update_paths` rebuild it with stop-then-start.

Between the stop and the start nothing is watching, so kernel events firing in that window are silently dropped for *every* watched path, not just the one being changed.
Since the new stream is created with `kFSEventStreamEventIdSinceNow`, the gap is never replayed.

Instead, start the replacement stream first and stop the old one only once the new one is running, so a stream is watching at every moment.
If the new stream fails to start, keep the old one so the previous path set keeps delivering.
@SomeoneToIgnore
SomeoneToIgnore merged commit 0890bbb into main Jul 21, 2026
18 checks passed
@SomeoneToIgnore
SomeoneToIgnore deleted the fsevents-resume-after-rebuild branch July 21, 2026 15:06
pull Bot pushed a commit to Jaleel-zhu/zed that referenced this pull request Jul 21, 2026
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.

2 participants