fix(turbo-tasks-fs): Handle filesystem watcher rescan events (#78045)
The notify crate requires handling rescan events with the event queue overflows. Context on this issue in the notify crate: - https://github.com/notify-rs/notify/issues/412 - https://github.com/notify-rs/notify/issues/434 - https://github.com/notify-rs/notify/pull/435 In our case, that means we should invalidate every file we've read in `turbo-tasks-fs`. We should also attempt to re-add filesystem watchers for every path, since some of those paths could've been removed and re-added. Tested this on Linux by lowering the inotify queue to something tiny to trigger frequent rescan events: ``` echo 3 | sudo tee /proc/sys/fs/inotify/max_queued_events rm -rf /tmp/fuzz && RUST_BACKTRACE=1 cargo run -p turbo-tasks-fuzz -- fs-watcher --fs-root /tmp/fuzz --notify-timeout-ms 100 --directory-modifications 0 echo 16384 | sudo tee /proc/sys/fs/inotify/max_queued_events # restore back to default ``` As a sanity check, I also tried running the fuzzer on macos, though it doesn't seem like there's as easy of a way to trigger rescan events on that platform (?).
Showing
This diff is collapsed.
Please
register
or
sign in
to comment