-
Notifications
You must be signed in to change notification settings - Fork 137
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
100% CPU and Memory usage since 0.18.2 #573
Comments
I am seeing the same behavior |
Confirmed, it just crashed my comp with 64GB RAM when I tried to save 3 open files. This is a critical bug. Is there a way to force the Hashicorp Terraform extension in VS Code to use an older version (0.18.1) instead? EDIT: Answered my own question (on Windows at least).
|
Hey @radeksimko The most useful logs, Memory, CPU, and TF Logs don't generate at all. The main log doesn't have any errors in it, it just seems to opening files by scanning the whole repo. If there's any way I can get more detailed logs then I could try, I tried turning on It just seems to load some modules in the repo up and then spirals out of control. |
I don't expect it to have errors, based on the snippet above but it would help to know what happens after the launch and which requests are and are not processed. Do you mind sharing the relevant part of the log?
Both CPU & memory profiles are written into after the shutdown of the process - which should happen automatically if you shut down VS Code. It is also worth mentioning that if you have multiple folders in your workspace then each folder would be served by a different LS process and so the flags should use the templating (such as https://github.com/hashicorp/terraform-ls/blob/main/docs/TROUBLESHOOTING.md#cpu-profiling Thanks. |
I tried to get the logs to generate but vscode doesn't generate them using 0.18.2 even after shutdown of vscode. |
@ElvenSpellmaker Do you mind sharing the configuration, so I can try reproducing it myself? You may also encrypt it and/or send it privately to |
@radeksimko I'll send the logs for 0.18.1 and 0.18.2 to your e-mail, they're not super private, but it'd be easier that way. 🙂 |
@ElvenSpellmaker was kind enough to provide a working repro case privately. I am still investigating the root cause, but I have some confidence to say that this is being triggered by some nested objects, such as locals {
top_obj = {
first = {
attr = "val"
}
second = {
attr = "val"
}
third = {
attr = "val"
}
fourth = {
attr = "val"
}
}
} ^ that is the most minimal snippet I was able to extract and still reproduce the bug Thank you for your patience. |
This brings in hashicorp/hcl-lang#64 Fixes #573
Thank you @ElvenSpellmaker for the report and for helping to reproduce this. It is fixed in VS Code should prompt you to upgrade upon next launch or in the next 24 hours. |
@radeksimko Excellent, thanks Radek! |
I can confirm the newer version seems to have patched the issue. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Server Version
Last Known Working version: 0.18.1
Terraform Version
Client Version
Terraform Configuration Files
N/A I think
Log Output
Logging for starters throws an error using the default on the troubleshooting page
Failed to setup logging for Terraform: template: tf-log-file:1: function "lsPid" not defined
.Either way I've tried to get the CPU and Memory logs and it never seems to generate any files (it was generating some 0 but CPU files but never populated them)
It generates the normal language server which ends with a lot of Receiving 1 notification:
And then stops.
Expected Behavior
VsCode to behave as usual
Actual Behavior
Memory and CPU spiral out of control almost making the system unusable. Killing the
terraform-ls
binary causes it to temporarily drop down.Steps to Reproduce
code .
with a project that contains terraform, within a few seconds of going to a tf file the CPU and memory will have spiralled out of control.The text was updated successfully, but these errors were encountered: