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

file.watcherExclude preference doesn't prevent watcher from being created #10794

Open
kenneth-marut-work opened this issue Feb 24, 2022 · 2 comments
Labels
file-watchers issues related to filesystem watchers - nsfw

Comments

@kenneth-marut-work
Copy link
Contributor

Bug Description:

Following the trail of options.exclude from the FileService's watch method doesn't seem to actually prevent a watcher from being created. It instead prevents a change event from being pushed into the event that is emitted from nsfw-filesystem-service (see pushFileChange method). This results in inotify resources still being consumed for no reason (correct me if I'm wrong).

In our downstream IDE, our users import large repositories (only for search/readonly purposes) in parallel with their working directories. These large repositories eat up file watcher resources even though they won't expect to see any changes. This can cause the UI to break and other files to not respond to changes (such as branch changes etc.). Experimenting with the exclude preference seems to have no affect.

Steps to Reproduce:

Using the script below to observe inotify consumers found here

curl -s https://raw.githubusercontent.com/fatso83/dotfiles/master/utils/scripts/inotify-consumers | bash

  1. Open Theia with a multiroot workspace with RootA and RootB
  2. Run the script and observe that X number of watchers are used by Theia (run it several times to make sure the number has reached steady state)
  3. Add RootA to files.watcherExclude and run the script again (reaching steady state as they watchers re count after the change)
  4. Observe the same number of file watchers are still being consumed

Additional Information

  • Operating System: Linux
  • Theia Version: master
@kenneth-marut-work kenneth-marut-work added the file-watchers issues related to filesystem watchers - nsfw label Feb 24, 2022
@paul-marechal
Copy link
Member

There is a fix for that on Linux in the following PR: Axosoft/nsfw#124

The PR is stalled because I wasn't able to figure out what to do with Windows. Help is welcome...

@paul-marechal
Copy link
Member

On the other hand VS Code seem to have moved from nsfw and chokidar to https://github.com/parcel-bundler/watcher.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
file-watchers issues related to filesystem watchers - nsfw
Projects
None yet
Development

No branches or pull requests

2 participants