test: retry fsevent startup - #928
Merged
Merged
Conversation
Anthony-Eid
added a commit
to zed-industries/notify
that referenced
this pull request
Jun 30, 2026
…down race (#7) * fix(fsevent): set `is: clone` info for more `IS_CLONE` events (notify-rs#814) * chore(deps): update rust crate futures to v0.3.32 (notify-rs#815) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.0 (notify-rs#816) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.1 (notify-rs#817) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.2 (notify-rs#818) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * docs(types): fix incorrect docs of `EventKindMask` (notify-rs#819) * docs: write up migration guide for v9 (notify-rs#820) * chore(deps): update taiki-e/install-action action to v2.68.3 (notify-rs#821) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.4 (notify-rs#822) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * test(fsevent): do not race on startup failure vs. tempdir cleanup (notify-rs#824) * feat: make Windows path style configurable (notify-rs#823) * chore(deps): update taiki-e/install-action action to v2.68.7 (notify-rs#826) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.8 (notify-rs#827) * fix(poll): recover from poisoned mutexes in watch/unwatch (notify-rs#825) Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com> * chore(deps): update taiki-e/install-action action to v2.68.9 (notify-rs#828) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.10 (notify-rs#829) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.12 (notify-rs#830) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.13 (notify-rs#831) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Exponential retry if fsevents test failed (notify-rs#834) * chore(deps): update rust crate nix to v0.31.2 (notify-rs#832) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.15 (notify-rs#833) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate tempfile to v3.26.0 (notify-rs#835) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.16 (notify-rs#836) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate tokio to v1.50.0 (notify-rs#837) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.17 (notify-rs#838) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.18 (notify-rs#839) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.19 (notify-rs#840) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat: add method to get watched paths (notify-rs#841) * feat: get watched paths * Add changelog entry * chore(deps): update taiki-e/install-action action to v2.68.20 (notify-rs#842) * chore(deps): update rust crate inotify to v0.11.1 (notify-rs#843) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.21 (notify-rs#844) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate libc to v0.2.183 (notify-rs#846) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.22 (notify-rs#845) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.24 (notify-rs#847) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.25 (notify-rs#848) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.26 (notify-rs#851) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate tempfile to v3.27.0 (notify-rs#852) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat(dobouncer-full): add `watched_paths` for `Debouncer` (notify-rs#850) * fix(windows): make `unwatch()` wait until the watch is fully removed (notify-rs#849) * chore(deps): update taiki-e/install-action action to v2.68.27 (notify-rs#853) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update swatinem/rust-cache action to v2.9.1 (notify-rs#854) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.28 (notify-rs#856) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.29 (notify-rs#857) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.31 (notify-rs#858) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.32 (notify-rs#859) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.33 (notify-rs#860) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.34 (notify-rs#861) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.35 (notify-rs#862) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.68.36 (notify-rs#863) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.69.2 (notify-rs#864) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.69.3 (notify-rs#865) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.69.5 (notify-rs#866) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.69.6 (notify-rs#867) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(ci): prefer raw toolchain setup (notify-rs#873) * Revert "fix(ci): fix CI on FreeBSD (notify-rs#776)" (notify-rs#872) This reverts commit a2766ce. * chore(deps): update rust crate env_logger to v0.11.10 (notify-rs#870) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.69.10 (notify-rs#869) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.69.11 (notify-rs#874) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.69.12 (notify-rs#875) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * test: try to fix flakiness (notify-rs#877) * chore(deps): update rust crate mio to v1.2.0 (notify-rs#878) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate insta to v1.47.0 (notify-rs#876) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.69.13 (notify-rs#879) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.69.14 (notify-rs#880) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.70.0 (notify-rs#881) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: open renovate PRs weekly (notify-rs#882) * chore: bump MSRV to 1.88 (notify-rs#884) * perf(notify-debouncer-full): avoid rebuilding queues during flush (notify-rs#883) * chore(deps): update rust crate insta to v1.47.2 (notify-rs#885) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate libc to v0.2.184 (notify-rs#886) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Add `must_use` annotation to config builder methods (notify-rs#887) * Add `must_use` annotation to config builder methods Otherwise callers might accidentally assume they are mutating e.g. vercel/next.js#92631 fixed a long standing bug in next.js because we failed to capture this return value * fix changelog * chore: drop Cirrus CI (notify-rs#889) * chore(deps): update rust crate tokio to v1.51.1 (notify-rs#892) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.75.5 (notify-rs#893) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * test(notify): forget tempdir to prevent flakiness (notify-rs#891) * chore(*): add `must_use` where possible (notify-rs#890) * chore(deps): update rust crate rand to v0.10.1 [security] (notify-rs#894) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * perf(debouncer-full): speed up hashing by `rustc-hash` (notify-rs#896) * chore(notify): prepare 9.0.0-rc.3 release (notify-rs#897) * chore(debouncer-full): prepare 0.8.0-rc.1 (notify-rs#899) * chore: declare security policy (notify-rs#898) * feat(notify): preserve watched path representations across backends (notify-rs#901) * feat(notify): preserve watched path representations across backends * refactor * chore(deps): update rust crate libc to v0.2.185 (notify-rs#904) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate bitflags to v2.11.1 (notify-rs#903) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Emit `remove` events even if a file was created and then removed (notify-rs#902) * Emit `remove` events event if a file was created and then removed Fixes notify-rs#900 * Apply suggestion from @JohnTitor --------- Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com> * perf: skip construction for unchanged stuff (notify-rs#905) * chore: fix clippy warnings (notify-rs#908) * fix(kqueue): do not infer file paths on non-recursive watcher (notify-rs#907) * fix: replace watcher when rewatching (notify-rs#906) * fix: replace watcher when rewatching * docs: add some comments * chore(deps): update taiki-e/install-action action to v2.75.22 (notify-rs#910) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate libc to v0.2.186 (notify-rs#909) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore: use zizmor to harden GHA usage (notify-rs#911) * perf: Optimize debouncer.watch() lookup time (notify-rs#913) * perf: Optimize debouncer.watch() lookup time Use sorted VecDeque on 30k invocations cuts down all the linear scanning work that has be done before. Cuts down 10s to 300ms * fix: preserve recursive root lookup with sorted watch roots * add changelog entry --------- Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com> * prepare notify v9.0.0-rc.4 release (notify-rs#914) * prepare notify-debouncer-full v0.8.0-rc.2 release (notify-rs#915) * chore(deps): update vmactions/freebsd-vm action to v1.4.5 (notify-rs#917) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update taiki-e/install-action action to v2.75.28 (notify-rs#916) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com> * perf(notify): speed up recursive inotify watch setup (notify-rs#918) * chore(deps): update rust crate trash to v5.2.6 (notify-rs#921) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate tokio to v1.52.3 (notify-rs#922) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * perf(fsevent): speed up flag convension (notify-rs#920) * fix(windows): emit Remove event when watched directory is deleted (notify-rs#923) * fix(windows): emit Remove event when watched directory is deleted ReadDirectoryChangesW returns ERROR_ACCESS_DENIED when the watched directory's handle is invalidated. The existing handler unwatches but does not emit any event (PR notify-rs#674), leaving consumers with a dead watch and no way to react. Bring Windows in line with inotify (PR notify-rs#540) and FSEvents, which both emit a Remove event when their watched root disappears. Adds a delete_self_dir test to each backend's test module covering the cross-platform contract. * prefer `try_exists` --------- Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com> * chore(deps): update zizmorcore/zizmor-action action to v0.5.5 (notify-rs#926) * chore(deps): update rust crate nix to v0.31.3 (notify-rs#927) * chore(deps): update rust crate nix to v0.31.3 (notify-rs#925) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * test: retry fsevent startup (notify-rs#928) * perf(notify): avoid filesystem walks for recursive kqueue unwatch (notify-rs#924) * perf(notify): avoid filesystem walks for recursive kqueue unwatch * Correct the changelog entry place * chore(deps): update rust crate serde_json to v1.0.150 (notify-rs#931) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update zizmorcore/zizmor-action action to v0.5.6 (notify-rs#932) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * feat(notify): make FSEvents stream latency configurable (notify-rs#930) * feat(notify): make FSEvents stream latency configurable Adds Config::with_fsevent_latency to control the latency passed to FSEventStreamCreate. Defaults to Duration::ZERO, preserving current behavior. Set at construction time only. * docs: add changelog entry --------- Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com> * chore(deps): bump kqueue to 1.2.0 (notify-rs#934) * chore(deps): bump kqueue to 1.2.0 This version adds a number of fixes to major problems, specifically in that it eliminates panics in failure conditions and substantially increases performance of watch removals. * update Cargo.lock --------- Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com> * fix(windows): report watch error correctly (notify-rs#936) * add test * windows: report watch error correctly * feat(notify-debouncer-full): use condvar for no idle CPU usage (notify-rs#933) * feat(notify-debouncer-full): use condvar for no idle CPU usage The existing code spawned a thread that looped forever and slept for one tick. This is valid, but results in some idle CPU usage. This adds a condvar that means that the debouncer loop will go back to sleep until such time as there are actually events to handle, eliminating the idle CPU usage. * refactor * add changelog entry --------- Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com> * chore(deps): update actions/checkout action to v6.0.3 (notify-rs#938) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate inotify to v0.11.2 (notify-rs#939) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate log to v0.4.32 (notify-rs#941) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate deser-hjson to v2.2.6 (notify-rs#940) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate bitflags to v2.13.0 (notify-rs#945) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update vmactions/freebsd-vm action to v1.4.8 (notify-rs#944) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com> * fix(fsevent): stop the run loop via a CFRunLoopSource to avoid a shutdown race `CFRunLoopStop` only takes effect while the target run loop is actually running. The FSEvents watcher thread publishes its run-loop handle and then enters `CFRunLoopRun`, so a concurrent `stop()` could call `CFRunLoopStop` in the window before the loop starts. That stop request is lost, the thread parks in `CFRunLoopRun` forever, and the `join()` in `stop()` deadlocks. Under heavy event load the loop may also never reach a "waiting" state, so approaches that wait for that are unreliable too. Replace the atomic stop flag plus direct `CFRunLoopStop` with a custom `CFRunLoopSource`. The source is created and added to the watcher thread's run loop before its handles are published, so the caller can never signal a source that isn't registered yet. `stop()` signals the source and wakes the loop; the source's perform callback then calls `CFRunLoopStop` from inside the run-loop thread, where it cannot be lost. Because source signals stay pending until processed, a stop that arrives before `CFRunLoopRun` is entered still stops the loop once it starts. Adds a deterministic test that a pre-run stop signal still stops the loop, and a rapid watch/unwatch stress test that would previously hang. --------- Co-authored-by: Yuki Okushi <huyuumi.dev@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Aditya Giri <74224708+adityagiri3600@users.noreply.github.com> Co-authored-by: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Co-authored-by: Luke Sandberg <lukesandberg@users.noreply.github.com> Co-authored-by: Daniel Faust <hessijames@gmail.com> Co-authored-by: Dmitriy Kovalenko <dmitriy@iusevimbtw.com> Co-authored-by: Richard Feldman <oss@rtfeldman.com> Co-authored-by: Brian Vincent <brainn@gmail.com> Co-authored-by: William Orr <will@worrbase.com> Co-authored-by: Gavin John <gavinnjohn@gmail.com> Co-authored-by: Cole Miller <cole@zed.dev>
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.
Description
Related Issues