fix(fs): await watcher readiness instead of yield_now#2533
Open
domenkozar wants to merge 4 commits intomainfrom
Open
fix(fs): await watcher readiness instead of yield_now#2533domenkozar wants to merge 4 commits intomainfrom
domenkozar wants to merge 4 commits intomainfrom
Conversation
Deploying devenv with
|
| Latest commit: |
6eaf4bd
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2b18e927.devenv.pages.dev |
| Branch Preview URL: | https://fix-fs-watcher-readiness.devenv.pages.dev |
Contributor
🔍 Suggested ReviewersBased on git blame analysis of the changed lines, the following contributors have significant experience with the modified code:
Please consider reviewing this PR as you have authored significant portions of the code being modified. Your expertise would be valuable! 🙏 This comment was automatically generated by git-blame-auto-reviewer Last updated: 2026-03-02T01:04:49.307Z |
Member
|
Oh, nice! We should remove the old |
fb3c83f to
56e9982
Compare
Use watchexec's new fs_ready signal to wait for OS watches to be registered before returning from FileWatcher::new(). This fixes a race where file changes immediately after construction were missed because inotify/FSEvents watches weren't set up yet. Also makes WatcherHandle::watch() async so runtime path additions get the same readiness guarantee. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
On CI, inotify events can be dropped under resource pressure or on overlay filesystems even after watches are confirmed registered. Retry file writes until an event is received instead of writing once. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Drain the watchexec error channel instead of dropping it so watch registration failures (e.g. inotify limits) are visible. Add tracing to the two CI-flaky tests for diagnostics. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
macOS FSEvents requires directory paths; individual file paths may be silently ignored. Watch parent directories and filter events against the actual watched file set. This matches watchexec's own recommendation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
56e9982 to
6eaf4bd
Compare
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.
Summary
fs_readysignal (from feat(config): add fs_ready signal for watcher readiness watchexec/watchexec#1024) to wait for OS watches to be registered before returning fromFileWatcher::new()WatcherHandle::watch_async()for runtime path additions that need the same readiness guaranteeTest plan
fs::testspass consistently across 5 runstest_multiple_filesandtest_handle_adds_path_at_runtime(previously flaky) now pass reliably🤖 Generated with Claude Code