Skip to content

tor-config: Use a recursive file watcher.

gabi-250 requested to merge gabi-250/arti:kqueue-bug into main

Without a recursive watcher, the watch_file_path and watch_dir_path tests stall on platforms that don't have inotify (see #1644 (closed)).

The two tests stall for different reasons though:

  • watch_dir_path stalls because of a bug in the notify crate that causes non-recursive watchers to incorrectly set the paths of events. See notify#644
  • watch_file_path fails for a different reason. Our implementation sets a watcher for the parent of the watched file, expecting there to be an event if that file changes. However, with a non-recursive watcher, that is only the case with the inotify backend. With kqueue, we need to either use a recursive watcher, or to watch the file itself, not just its parent.

The simplest solution here is to just use a recursive watcher, which happens to fix both tests.

This is based on @nickm's findings in #1644 (closed) (thank you @nickm for debugging this!)

Closes #1644 (closed)

Merge request reports

Loading