unisonweb/unison

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

Open

#1,438 建立於 2020年4月19日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)Haskell (6,624 star) (304 fork)batch import
help wanted

描述

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 https://github.com/haskell-fswatch/hfsnotify/issues/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

貢獻者指南