-
Notifications
You must be signed in to change notification settings - Fork 210
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
add_watch() returns Error if any subdirectories contain symlinks. #17
Comments
Here is a minimal failing example: https://github.com/SirVer/notify_crash Crash occur-es in this line on unwrap: |
Can you post the output of the crash if any? |
Most certainly:
|
Ping? This is quite the blocker for me and I have no idea what might be wrong here. |
Ah, sorry, I tend to do open-source work during weekends. Here's a brain dump if you want to investigate: This is most certainly going to be an inotify issue. There's two components at play: the recursive watcher which is in rsnotify code, and the inotify API. I'd recommend reading through the entire Gut feeling is that the recursive watcher is seeing the symlink as a directory and trying to get inotify to place a watch on that but it can't or fails for some other reason. Resolution here would be to detect that something is a symlink and do dereference or just ignore it completely, or some other behaviour. Another thing to investigate is if this only happens with symlinks, or if hardlinks cause a panic as well. They shouldn't, due to their different nature, but you never know. Also, it would be interesting to try with a symlink that's pointing to a file, and a symlink that's pointing to a folder, and finally a dangling symlink. You could push it even further to see what happens when going across filesystem boundaries, i.e. Finally, try to figure out what exactly is an IO Error with the Rust signature Hope that helps, if you have trouble I'll take a look this weekend anyway. |
Thanks for all the insight! I will not be able to look into this this weekend and next week. The weekend after I'll should have time again to look into your suggestions more specifically. If you already have found something out by then I will of course be most grateful too :) |
I may have a similar issue when working with Emacs lockfile Every time I made a change in emacs, error received:
|
@sunng87 Can you open a separate issue ? Yours happens at watch-time, when a file is changed. OP's happens at |
Sure, I will. |
Jus sayin' :) |
@octplane Right, if the link is self referrencing, that is the error. Other links incur crashes too though:
|
Tested on linux, notify 2.0.0.
The text was updated successfully, but these errors were encountered: