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

vscode ignores files.watcherExclude #2974

Closed
mic-e opened this issue Jun 27, 2022 · 5 comments
Closed

vscode ignores files.watcherExclude #2974

mic-e opened this issue Jun 27, 2022 · 5 comments
Assignees
Labels
needs investigation Could be an issue - needs investigation

Comments

@mic-e
Copy link

mic-e commented Jun 27, 2022

Environment data

  • Language Server version: 2022.6.30
  • OS and version: Ubuntu 20.04 LTS
  • Python version: 3.8.10 (default, Mar 15 2022, 12:22:08)
  • Visual Studio Code version: 1.68.1

Expected behavior

PyLance watches all files that are relevant to the project, but ignores files that are listed in the VSCode setting files.watcherExclude

Actual behavior

PyLance ignores files.watcherExclude

Description

This is a possible follow-up to #2914.

I work with a SSH remote host; on this host I am not able to adjust the maximum number of inotify watches.

PyLance immediately opens the maximum amount (8172) of file watches, using up all resources. Because of this, basic system commands such as journalctl -f stop working properly while VSCode is connected to the remote system.

When inspecting the inotify watches I can see that pylance is monitoring many files in /usr/lib/python3.8, /usr/lib/python3/dist-packages, /opt/ros/noetic/lib/python3/dist-packages.

I attempted to blacklist these folders through the files.watcherExclude setting by adding entries such as /usr/lib/python3/** but this had no effect.

@heejaechang heejaechang self-assigned this Jun 28, 2022
@heejaechang heejaechang added the needs investigation Could be an issue - needs investigation label Jun 28, 2022
@github-actions github-actions bot removed the triage label Jun 28, 2022
@heejaechang
Copy link
Contributor

@mic-e thank you for the issue. we will start discussing the issue with vscode file watcher team. we ask vscode to watch file for us, but we don't watch them ourselves. vscode file watcher should respect the option and exclude those folders from watching. let me figure out what is going on.

@heejaechang
Copy link
Contributor

heejaechang commented Jun 29, 2022

@mic-e vscode should respect the option and exclude folders from watching. I also just tested it myself on windows and confirmed that it works as expected. if it didn't work on linux, It sounds like a bug in vscode file watcher implementation.

by the way, files.watcherExclude is not our option but vscode (platform)'s option we run on that will take precedence over us on what to watch.

@heejaechang heejaechang changed the title Pylance ignores files.watcherExclude vscode ignores files.watcherExclude Jun 29, 2022
@heejaechang
Copy link
Contributor

@mic-e it looks like github doesn't allow me to transfer this issue to vscode repo. can you open new issue on vscode repo (https://github.com/Microsoft/vscode)? vscode should respect the option, if not, vscode side needs to fix the bug.

@heejaechang
Copy link
Contributor

looks like there are a few existing issues on vscode.

microsoft/vscode-remote-release#6436
microsoft/vscode#137872

@binh-vu
Copy link

binh-vu commented Jul 6, 2022

I also had this issue on Centos 7, where I cannot control the maximum number of inotify watches.

I believe the mentioned issues (microsoft/vscode-remote-release#6436, microsoft/vscode#137872) are when they try to use glob pattern. For now on Linux, the vscode team recommended to use the full path or relative path to the workspace directory.

I did try with the full path:

"files.watcherExclude": {
    "${workspaceFolder}/.venv": true,
    "/home/user/anaconda3/lib/python3.9": true
}

Without activate pylance, I didn't have any error. As soon as I open a python file, I got file watcher error:
[error] [File Watcher (parcel)] Inotify limit reached (ENOSPC) (path: /home/user/anaconda3/lib/python3.9). So it watches the excluded folder outside of the workspace.

This is related to the issue #2914 and is said to be fixed in version 2022.6.30. I tested on that version and the latest, and it still doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation Could be an issue - needs investigation
Projects
None yet
Development

No branches or pull requests

3 participants