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 (os error 28)' when watching too many files #266

Closed
jyn514 opened this issue Nov 4, 2020 · 8 comments · Fixed by #285
Closed

'Error: No space left on device (os error 28)' when watching too many files #266

jyn514 opened this issue Nov 4, 2020 · 8 comments · Fixed by #285
Assignees
Milestone

Comments

@jyn514
Copy link

jyn514 commented Nov 4, 2020

System details

  • OS/Platform name and version: Linux build-server 4.19.0-10-amd64 #1 SMP Debian 4.19.132-1 (2020-07-24) x86_64 GNU/Linux
  • Rust version (if building from source): rustc --version: rustc 1.49.0-nightly (ffe52882e 2020-10-30)
  • Notify version (or commit hash if building from git): 5.0.0-pre.3
  • 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: See bacon crashes on rustc Canop/bacon#10.
  • Filesystem type and options: ext4, errors=remount-ro
  • If you're running as a privileged user (root, System): no

What you did (as detailed as you can)

I ran notify on src/ of rust-lang/rust with RecursiveMode::Recursive.

What you expected

Either it should work, or notify should give a helpful error when trying to watch too many files.

What happened

notify printed Error: No space left on device (os error 28).

@0xpr03
Copy link
Member

0xpr03 commented Nov 4, 2020

Quick note: You may already know about raising your max-files limit to watch. The error reported is not correct, I'll have to see whether this is labeled wrongly or may be coming from an internal (std?) part that reports this code as "no space left".

@0xpr03 0xpr03 added the A-bug label Nov 4, 2020
@0xpr03 0xpr03 self-assigned this Nov 4, 2020
@jyn514
Copy link
Author

jyn514 commented Nov 4, 2020

$ man inotify_add_watch
       ENOSPC The  user  limit on the total number of inotify watches was reached or the kernel failed to allocate a needed
              resource.

Looks like this is wrong in the standard library - ENOSPC should not always be described as 'no space left'.

@0xpr03
Copy link
Member

0xpr03 commented Nov 4, 2020

(Appeared also in #103 )

@jyn514
Copy link
Author

jyn514 commented Nov 4, 2020

@0xpr03 an option to workaround the upstream issue is to wrap io::Error in a new error type if the error is ENOSPC. Then you could give a more helpful error message.

@jyn514
Copy link
Author

jyn514 commented Nov 4, 2020

It turns out this is a bug in libc itself 🤦 rust-lang/rust#78723 (comment). So I think it makes sense to fix in notify, even though it shouldn't have to.

@0xpr03
Copy link
Member

0xpr03 commented Nov 5, 2020

Yeah, I'll do a change for this.

@0xpr03
Copy link
Member

0xpr03 commented Apr 15, 2021

This is released for v4 in 4.0.16

@0xpr03
Copy link
Member

0xpr03 commented Apr 15, 2021

And for v5 in 5.0.0-pre.7

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

Successfully merging a pull request may close this issue.

2 participants