Skip to content

Emit a warning when scratch file watching is broken due to lack of inotify watches #1438

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

Open
atacratic opened this issue Apr 19, 2020 · 0 comments

Comments

@atacratic
Copy link
Contributor

For Linux users, ucm will fail to react to changes to their scratch files, if their system has run out of inotify watches. I've hit that due to running a backup utility. Linux seems to have a low default limit here that it's easy to run into.

This ticket covers getting unison to emit a warning saying "you've hit this error case, here's what to do".

I fear it may be unfixable without changes to hfsnotify - this code https://github.com/haskell-fswatch/hfsnotify/blob/master/src/System/FSNotify/Linux.hs#L99 looks a bit devoid of error handling for adding a recursive listen. And haskell-fswatch/hfsnotify#85 suggests others may have found the same. (The relevant unison code is at https://github.com/unisonweb/unison/blob/master/parser-typechecker/src/Unison/Codebase/Watch.hs#L64 )

It's not fundamentally impossible to emit a message: tail -f emits the following when it hits this case as it tries to add an inotify watch.

tail: inotify cannot be used, reverting to polling: Too many open files

I've raised a PR on the docs site to add an FAQ entry for this. That's not worth much though: people are much more likely to give up than to find that FAQ, if they hit this issue.

Hopefully the fact that this hasn't come up on the slack means it can't be very prevalent. Maybe it's just my backup application (Tresorit).

Previously mentioned under #812

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