-
Notifications
You must be signed in to change notification settings - Fork 235
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
Bad file descriptor when using notify 4.0.15 #282
Comments
I can't seem to reproduce this, especially not "Bad file descriptor". Do you have any kind of special file system underlying this ? For example fuse mounts (remote stuff) or such things ? Is this always reproducible (for example across reboots)? |
Could you retry this with the following: notify = "5.0.0-pre.5" main.rs use notify::{Watcher, RecommendedWatcher, RecursiveMode, Result};
fn main() -> Result<()> {
// Automatically select the best implementation for your platform.
let mut watcher: RecommendedWatcher = Watcher::new_immediate(|res| {
match res {
Ok(event) => println!("event: {:?}", event),
Err(e) => println!("watch error: {:?}", e),
}
})?;
// Add a path to be watched. All files and directories at that path and
// below will be monitored for changes.
watcher.watch("/home/test/notify", RecursiveMode::Recursive)?;
loop {
// just sleep
std::thread::sleep_ms(100000);
}
Ok(())
} |
With your changes, I got this when running
|
Do any of these apply ? Because based on your output its not dependent on some of the recent changes and happens regardless of the major version. And as long as I can't reproduce this, it's pretty hard to pin from where we get invalid file handles. |
I have nothing exotic as you ask. No special file system, no fuse mounts. I retried after reboot, same behaviour. |
Ok thanks, problem is that this will make it kinda guesswork to trace down (and requires more work to inspect). To rule out the possibility of user limitations regarding file permissions and watch permissions: Does it change anything if you run this example as root (sudo) ? Also: It does happen regardless of the directory you're trying to watch ? Like a folder that only contains ~2 files and no active process that is changing things or locking them. For example the |
I'm having the same issue using mdBook from the Void Linux repos, makes me think it's a distro-specific issue.
|
Ok, my issue was also on VoidLinux. So it could be because of the Void package ? |
got same problem. notify is not helpful with this error message. on linux notify uses inotify, install inotify-tools and do : in my case this fixed the problem :
|
I'm raising the inotify limit issue as something to be fixed via better error reporting. Possibly looking into whether For now documented in the next release via #395 |
Note that a similar issue is fixed in v5: #266 Although the error message is different. Needs confirmation. |
System details
rustc --version
: 1.48.0What you did (as detailed as you can)
Because the use of the
serve
command fromzola
didn't work, I tried to look at thenotify
dependency as suggested by a zola user:get this error (full backtrace):
What you expected
I was expected it working
What happened
I got an error as described.
The text was updated successfully, but these errors were encountered: