-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
TypeScript file Watcher consuming over 5k watchers #46351
Comments
@oof2win2 thanks for testing this. As a first question, can you run It would also give a hint what excludes are actually being used. |
@oof2win2 oh, so this is an issue you see with connecting remotely via SSH to a Linux remote? If that is the case you will have to change the log level via this command: To "trace" and then see the output via "Log (Server)" in output panel. |
Ah, then the output is this:
|
So it looks like 2 file watchers are installed (with parcel) and |
Yeah, I think that doesn't work. The excludes have |
|
Yes, a That said, it is possible that something else is consuming file handles that is not the file watcher maybe? |
Like a different app or service? Not sure what it would be. Without any extensions (except SSH), the file watchers stay. Disconnecting from the remote frees it of any watchers from the VSCode server executable. |
@oof2win2 can you validate this again without opening any files? the file watcher will start independent from individual files opening as long as you open the folder |
With no files open, the system total of watchers is 70. The workspace is open. |
@oof2win2 ok that confirms to me that something else is starting to install watchers. Is it possible that the files you open start an extension (such as "TypeScript") and they install further file watchers? To proof that point, you could try to disable all extensions (on the server as well as client). |
The |
Yes quite possibly the TS extension is setting up their own file watching. This is nothing I have control over. |
Yes the typescript server has its own file watcher. Moving upstream to TS |
Would be good to understand why that is required. |
@oof2win2 could you collect a TS Server log and post it here? |
That log shows that we add 5 directory watchers and 4 file watchers. Granted, file watching is complicated and I know very little about it, but this sounds expected for us and doesn’t sound like we are adding 5k watchers. |
Why can you not rely on the file events VS Code sends for a workspace to your extension? |
Looked at the log just now and it seems that TS finds all typescript stuff scross the system and then watches it just if something happens? I agree with @bpasero that TS should listen to VSCode's ignores and not watch files if they are in the ignore path. |
Fyi microsoft/vscode#146066 makes the My understanding is that TypeScript does not require recursive watching because you only need to watch the |
If anyone wants to do custom watching, we do allow users to exclude directories and folders from watches.. So users can opt to disable watching and refresh the state as they like but our watching tries to cater for various types of scale and uses and also os variants. |
This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
Issue Type: Bug
Since the latest update of Insiders, it has begun to use a new file watcher (from what I see here and the new
Files: Legacy Watcher
setting). My issue however is that this is not working and file watchers are still being consumed.This is the output of
inotify-consumers
,npm i
and then runninginotify-consumers
again. To note,node_modules/
was removed prior to the first consumer check.Here are my settings.json. Used this as just
"**/node_modules/**: true
, which is included, did not work.VS Code version: Code - Insiders 1.62.0-insider (284e0db6c4cac1e557a43cd6691babdaafc2e1a9, 2021-10-12T05:44:21.888Z)
OS version: Darwin x64 20.5.0
Restricted Mode: No
Remote OS version: Linux x64 5.4.0-80-generic
System Info
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Extensions (4)
A/B Experiments
The text was updated successfully, but these errors were encountered: