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

Conflict with other extensions which cause huge high cpu load #132

Open
ssbarnea opened this issue Apr 17, 2021 · 4 comments
Open

Conflict with other extensions which cause huge high cpu load #132

ssbarnea opened this issue Apr 17, 2021 · 4 comments
Assignees

Comments

@ssbarnea
Copy link

ssbarnea commented Apr 17, 2021

In ansible/vscode-ansible#58 (comment) @aliusmiles reported a discovery he made related to this extention. It causes huge CPU usage because it does open all yaml files inside a repository, which is triggering validations from other extensions.

While I did not look at the code of this extension I suspect that its LSP implementation is faulty as it ends up notifying vscode about file being opened, thus causing a chain effect. The result is of some kind of DDOS nature if repository has >100 YAML files because some validations are very CPU intensive (i know for sure that vscode-ansible requires ~2s per file at minimum).

Please install https://marketplace.visualstudio.com/items?itemName=zbr.vscode-ansible and investigate it. That extension will also install the YAML extension which is one of the most popular vscode extension ever.

Based on the line from https://github.com/threadheap/serverless-ide-vscode/blob/master/packages/vscode/package.json#L58 i believe that your extension affects any YAML files and not only those one would believe based on its description. This means that is prone to cause lots of conflicts.

I am the author of the vscode-ansible extension, so please let me know if there is something I can do on my side to address these issues.

@ssbarnea
Copy link
Author

@pavelvlasov Can you please confirm that you read this? CPU hogging is an issue that no vscode used can ignore.

@pavelvlasov
Copy link
Contributor

hey, @ssbarnea 👋 the plugin scans yaml files in the workplace on the startup, so I guess it causes the behavior you described. I don't think you can do anything on your side, but I'd rather make this behaviour optional and disable it by default in the next versions of the plugin.

I'll try to come up with a fix in the next few days.

Thanks for reporting 👍

@ssbarnea
Copy link
Author

Thanks for replying. I kinda have a similar problem with my plugin around startup but decided to delay implementation of full scan at start. Maybe we should ask someone as m$ about what is the recommended way to perform a project level linting when the directory is opened inside the workspace. We clearly do not want to make vscode believe the files are really opened (thus affecting any extension that watches for open file event). In my case linting is done be external tool, so I would not need to worry much, I only need to be careful to call it only once for all files instead of once for each file.

@drAlberT
Copy link

is a fix been released already?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants