Show message if insufficient file watcher handles#8458
Conversation
There was a problem hiding this comment.
I was able to trigger the message using sudo sysctl -w fs.inotify.max_user_watches=16, and got no message once the value was high enough.
Although it might be unrelated to this change, but when clicking on the Instructions link it opened the same tab 4 times instantly.
| }); | ||
| await watcher.start(); | ||
| } catch (error) { | ||
| if (error.message === 'NSFW was unable to start watching that directory.') { |
There was a problem hiding this comment.
Do you know how to land in this state?
There was a problem hiding this comment.
This is the error I was getting back when I first worked on this. After rebasing etc I started getting the Inotify message in the callback. It may have been a bad build. I was never happy with this code here, and the message is too generic so may be caused by other problems, perhaps on Windows and Mac. I will spend more time seeing if I hit this code again and, if not, I'll remove it.
There was a problem hiding this comment.
I've now removed this check as I cannot reproduce the condition that caused it. I also removed the link to instructions in the browser version as the user can't change the inotify limit on the server.
7894536 to
cef8236
Compare
I have not seen that but, looking at the code, it is clear what the problem is. |
cef8236 to
616daaf
Compare
CHANGELOG.md
Outdated
| - While registering a command, `Event` should be passed down, if not passed, then the commands will not work correctly as they no longer rely on the activation of tab-bar | ||
| - [core] Moved `findTitle()` and `findTabBar()` from `common-frontend-contribution.ts` to `application-shell.ts` [#6965](https://github.com/eclipse-theia/theia/pull/6965) | ||
|
|
||
| - [core] show Linux users a warning when Inotify handles have been exhausted, with link to instructions on how to fix [#8458](https://github.com/eclipse-theia/theia/pull/8458) |
f0b40ca to
7ea3cdf
Compare
Signed-off-by: Nigel Westbury <nigelipse@miegel.org>
What it does
Fixes #938
On Linux the limit for the number of directories that can be watched is by default 8192. Furthermore, if a watched directory has sub-directories then each sub-directory is counted in this limit. When this limit is reached, the user is not told. They simply don't see changes.
This PR shows a message to the user together with instructions on how to increase the limit.
How to test
On Linux, set the limit to 8192 (the default) and check that a message appears when the limit is reached.
Check that the message does not appear when the limit is larger, or on Windows or Mac. Test file watching and filesystem provider plugins to ensure nothing is broken.
Check that it is fine to link to vscode's page, or suggest Theia's own page.
Review checklist
Reminder for reviewers