fs: Cool down after macOS FSEvent stream failures - #59571
Open
vxio wants to merge 2 commits into
Open
Conversation
Amp-Thread-ID: https://ampcode.com/threads/T-019ed6c7-e016-752f-9480-bad29122a3db Co-authored-by: Amp <amp@ampcode.com>
vxio
force-pushed
the
fix/macos-fsevent-watch-cooldown
branch
from
June 18, 2026 20:21
227da20 to
f30db8e
Compare
vxio
marked this pull request as ready for review
June 18, 2026 20:48
5 tasks
|
Hit the same error signature on macOS — in my case the FSEvent stream failures came from fd exhaustion after days of uptime, and the 2s retry loop kept hammering the exhausted process. I filed #62486 with the full diagnosis (including what leaks the watchers in the first place), and opened #62489 which bounds the retry loop with a backoff. Your cooldown classification and that backoff look complementary to me: yours gates new registrations for this specific failure, mine slows the per-path retry for any registration error. |
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.
Hey Zed team!
Problem
When I have several semi-large project/repos open in Zed, everything keep freezing up even after I would Force Quit and restart.
Debug and logs
The app log repeatedly printed
unable to start FSEvent streamfor many watcher registrations before restart. The native watcher cooldown path already handlesnotify::ErrorKind::MaxFilesWatch, but on macOS this failure can surface asnotify::ErrorKind::Generic("unable to start FSEvent stream"), so those registrations keep retrying instead of backing off.The relevant local log pattern was:
That run had 391 consecutive
unable to start FSEvent streamfailures between 11:45:10 and 11:46:23, followed by a Zed restart.This treats that macOS-specific error the same as the existing native watch-limit case and adds a regression test for the cooldown behavior.
Related to #57042 and #58678.
Self-Review Checklist:
Release Notes: