Skip to content

Comments

Fix: INotifyWatcher keeps watching deleted paths#720

Merged
JohnTitor merged 3 commits intonotify-rs:mainfrom
riberk:inotify_unwatch_unknown_fd
Jan 12, 2026
Merged

Fix: INotifyWatcher keeps watching deleted paths#720
JohnTitor merged 3 commits intonotify-rs:mainfrom
riberk:inotify_unwatch_unknown_fd

Conversation

@riberk
Copy link
Contributor

@riberk riberk commented Oct 20, 2025

This PR fixes #709. Full information about the bug are described in the documentation for the remove_single_descriptor method.

The main problem was, that we tried to remove descriptor from the inotify.watches(), and, if it was completed successfully, it would be deleted from the hash descriptor -> path. But after FS entry deletion its file descriptor is invalidated and causes an error, which interrupts deletion from the hash

Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you and sorry for the delay! LGTM.

@JohnTitor JohnTitor merged commit 4476844 into notify-rs:main Jan 12, 2026
17 checks passed
JohnTitor added a commit that referenced this pull request Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inotify: Removing a subdirectory in a recursively watched directory and then unwatching causes an error

2 participants