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

Error "No space left on device" #103

Closed
astraw opened this issue Dec 21, 2016 · 2 comments
Closed

Error "No space left on device" #103

astraw opened this issue Dec 21, 2016 · 2 comments

Comments

@astraw
Copy link
Contributor

astraw commented Dec 21, 2016

Hi, I'm having trouble getting the example monitor_debounced to run without error on linux (kernel 3.16 debian amd64) compiled with rustc 1.13.0.

It seems to run fine on most directories on my filesystem (ZFS from zfsonlinux.org), but there are at least two directories where I get a "No space left on device" error. The distinguishing feature of these directories is that there are many files and subdirectories (e.g. hundreds of thousands of files and tens of thousands of subdirectories).

The thing is, I don't know what device should have no space left. The filesystem in question has 45 TB free and the root filesystem (with /tmp) has 97 GB free. Also, diving into the code I don't see any temporary file allocations. Any hints on what's behind this and how to debug it?

# ./monitor_debounced plots
watching plots
error: Io(Error { repr: Os { code: 28, message: "No space left on device" } })
@dfaust
Copy link
Member

dfaust commented Dec 21, 2016

It's inotify's way of saying that the watch limit has been reached. (Having a dedicated error type for that case in rsnotify might be a good thing though.)
Have a look at http://unix.stackexchange.com/questions/13751/kernel-inotify-watch-limit-reached for more information about the inotify watch limit and how to raise it.

@astraw
Copy link
Contributor Author

astraw commented Dec 21, 2016

Thanks, that makes sense.

I'm not sure that a dedicated error type or error handling is needed. In this case, errno is set to ENOSPC by the system call, which seems totally reasonable. (And is described in the man page for inotify_add_watch as "The user limit on the total number of inotify watches was reached or the kernel failed to allocate a needed resource.").

I was confused by the std::fmt::Debug implementation of std::io::Error, which is where the "No space left on device" message comes from.

Perhaps it could be argued that inotify_add_watch should have used a specialized errno, but that ship has sailed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants