Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inotify: files pointed at by multiples symlinks generate events only for one path #572

Open
hugwijst opened this issue Mar 7, 2024 · 1 comment · May be fixed by #573 or #635
Open

inotify: files pointed at by multiples symlinks generate events only for one path #572

hugwijst opened this issue Mar 7, 2024 · 1 comment · May be fixed by #573 or #635

Comments

@hugwijst
Copy link

hugwijst commented Mar 7, 2024

System details

  • OS/Platform name and version: Linux 6.5.0 - Ubuntu 22.04.3
  • Rust version (if building from source): rustc --version: rustc 1.75.0-nightly (0f44eb32f 2023-11-09)
  • Notify version (or commit hash if building from git): 6.1.1
  • If you're coming from a project that makes use of Notify, what it is, and a link to the downstream issue if there is one: buck2 (https://buck2.build)
  • Filesystem type and options: ext4
  • On Linux: Kernel version: 6.5.0

What you did (as detailed as you can)

I have a directory structure similar to the following:

- root
| - common
| | - file.json
| - tests
| | - test_1
| | | - common -> ../../common

We put a recursive watch on root, and then modify root/common/file.json.

What you expected

Either one of:

  • Notify events for both root/common/file.json and root/tests/test_1/common/file.json.
  • Notify events for just root/common/file.json

What happened

Only a notify event is fired for root/tests/test_1/common/file.json.

@hugwijst
Copy link
Author

hugwijst commented Mar 7, 2024

Relates to #255, #291, and #381, but seems distinct.

Reading https://docs.rs/inotify/latest/inotify/struct.Watches.html#attention-updating-watches-and-hardlinks, possibly the easiest way to solve this behavior is to keep a list of paths for each WatchDescriptor and add to that list at- https://github.com/notify-rs/notify/blob/main/notify/src/inotify.rs#L454.

hugwijst pushed a commit to hugwijst/notify that referenced this issue Mar 8, 2024
As a single change event can now refer to multiple paths, use "path
groups" for renames to differentiate sources and destinations.

Fixes notify-rs#572.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant