-
Notifications
You must be signed in to change notification settings - Fork 2.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
File watcher creates lag in the terminal #10283
Comments
@anavarre given you are on ubuntu, can you confirm how many |
We used to be on Ubuntu's
It didn't positively affect the behavior. |
@anavarre can you confirm the issue also exists for the electron (desktop) version. I want to confirm it's actually an issue with file-watchers and not your setup or network. |
I've never tried the desktop version and don't know that we can easily build it to connect to our remote IDEs that are behind OAuth. But to your point:
It's happening to countless people all around the world (though we're hosted on AWS |
I can confirm I'm experiencing this issue too. @vince-fugnitto are there any debugging steps you'd suggest? Any additional info I can provide? |
@anavarre @grasmash I don't have any suggestions other than tracing and debugging to see why the watchers would impact the terminal (likely using up the websocket). I also wanted to mention that the glob will not work to exclude all files: "files.watcherExclude": {
"/**": true
} Will not match for instance resources at the root of the workspace and Testing with the base framework (sources) I was not able to reproduce a lag when using the terminal, I wonder if it has to do with the example used and many changes or opened files. |
Erm, how does trace and debug a watcher? I'm happy to learn new tools for this. Can you suggest a starting point? |
The watchers would be debugged on the backend, likely a good place to start would be the following two files:
It should be possible to already set up tracing to see what exactly is going on, and consuming resources that would make the terminal lag in your case. Also, the following is how theia/packages/workspace/src/browser/workspace-service.ts Lines 601 to 620 in 88833b8
|
So, the lag is very regular. It happens for about 1 second every 5 seconds. I suspect this may be the debounce interval for nsfw. Would it be possible to configure this interval to be longer? If so, what is the best way to pass that configuration to Theia? |
@grasmash following #7465 (comment) you should be able to pass the options you'd want in a custom extension. It might be good to try! |
Will try. I think this is what I need in a backend module: import { ContainerModule } from '@theia/core/shared/inversify';
import { NsfwOptions } from '@theia/filesystem/lib/node/nsfw-watcher/nsfw-options';
export default new ContainerModule((bind, unbind, isBound, rebind) => {
rebind(NsfwOptions).toConstantValue({
// Change node-sentinel-file-watcher to only check for filesystem changes every 10 seconds.
debounceMS: 10000
})
}); |
Unfortunately, this is not have the intended effect. I can confirm that I correctly implemented the debounce variable and the file tree updates were delayed by the set amount. however, the regular lag every five seconds persisted. |
Closing because we have updated 8 versions of Theia and have resolved Kubernetes issues participating in terminal lag, so I don't think there's anything to fix anymore. |
Bug Description:
Having more than 1 file or directory tracked by the file watcher creates lag when typing in the terminal. Note that the issue with the file system watcher was reported multiple times:
Steps to Reproduce:
settings.json
viaFile->Settings->Open Preferences
and click on{}
to edit the preferences as JSON.files.watcherExclude
block so it looks like this (which excludes ALL files from the watcher):As an alternative, the same observation should be possible with a large project with many files and directories...Theia's codebase maybe?
settings.json
.rm -rf ./*
to wipe all files and directories.rm -rf .git
and reload, then the lag goes awaysettings.json
So somehow, once the file watcher registers a file, the presence of it will continue to cause lag even when the file watcher is then disabled or updated to be more aggressive with excluding files. You must both disable to file watcher and remove the files to remove the lag.
Additional Information
The text was updated successfully, but these errors were encountered: