-
Notifications
You must be signed in to change notification settings - Fork 44
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 /usr/share/code/code --ms-enable-electron-run-as-node hardhat solidity consumes CPUs! #211
Comments
@AuroraLantean thanks for the feedback. To clarify, do you mean that you had a hardhat project open, but where doing no editing on solidity files so why is the plugin consuming so much CPU? |
I am having the same issue with version 0.4.4. I didn't know why when I open vscode ( with a project) it just starts using high cpu and never ends ( without even touching anything). I started disabling all extensions until I found it's from Solidity+Hardhat extension. I downgraded it to 0.4.3 and the issue was resolved.
So I suppose it was trying to continue the process that was not completed before last exist. Interestingly there was no such condition for my project. so definitely this new fix has brought a new bug! |
Same here, constantly high CPU usage when the plugin is enabled and the workspace contains Solidity file(s). No issues when opening a workspace containing no Solidity. It is turning my MacBook into a vacuum 😆 |
Thanks for the reports. I suspect it is getting stuck in a loop while trying to load the hardhat config and restarting. I will put a fix together. |
To stop a restart loop on bad hardhat config the hardhat worker has been enhanced to have a lifecycle. The backgroun process starts as UNINITIALIZED. On `init` it moves to `STARTING`. Any unexpected exits during starting moves it to `INITIALIZATION_ERRORED`. Only an edit to the config file will trigger a retry from this state. On initialization completing within the background process, it will send a `INITIALISATION_COMPLETE` message, that will move the state to `RUNNING`. An unexpected exit while `RUNNING` will lead to a restart. Validation requests to the process if it is not in the running state (so errored or still starting), leads to a validator error which will be displayed to the user. In response to #211.
To stop a restart loop on bad hardhat config the hardhat worker has been enhanced to have a lifecycle. The background process starts as UNINITIALIZED. On `init` it moves to `STARTING`. Any unexpected exits during starting moves it to `INITIALIZATION_ERRORED`. Only an edit to the config file will trigger a retry from this state. On initialization completing within the background process, it will send a `INITIALISATION_COMPLETE` message, that will move the state to `RUNNING`. An unexpected exit while `RUNNING` will lead to a restart. Validation requests to the process if it is not in the running state (so errored or still starting), leads to a validator error which will be displayed to the user. In response to #211.
To stop a restart loop on bad hardhat config the hardhat worker has been enhanced to have a lifecycle. The background process starts as UNINITIALIZED. On `init` it moves to `STARTING`. Any unexpected exits during starting moves it to `INITIALIZATION_ERRORED`. Only an edit to the config file will trigger a retry from this state. On initialization completing within the background process, it will send a `INITIALISATION_COMPLETE` message, that will move the state to `RUNNING`. An unexpected exit while `RUNNING` will lead to a restart. Validation requests to the process if it is not in the running state (so errored or still starting), leads to a validator error which will be displayed to the user. In response to #211.
To stop a restart loop on bad hardhat config the hardhat worker has been enhanced to have a lifecycle. The background process starts as UNINITIALIZED. On `init` it moves to `STARTING`. Any unexpected exits during starting moves it to `INITIALIZATION_ERRORED`. Only an edit to the config file will trigger a retry from this state. On initialization completing within the background process, it will send a `INITIALISATION_COMPLETE` message, that will move the state to `RUNNING`. An unexpected exit while `RUNNING` will lead to a restart. Validation requests to the process if it is not in the running state (so errored or still starting), leads to a validator error which will be displayed to the user. In response to #211.
@danielattilasimon, @AuroraLantean We have pushed a fix for high cpu in some cases (specifically a restart loop from bad hardhat configs), can you try version |
Thank you so much! The issue is fixed on my end 🙏 Interesting that it happens with bad configs. Maybe I should take a closer look at ours 😅 |
Somehow this plugin consume a lot of CPU time, and I do not know why.
At that time I was not running Hardhat test or developing on Hardhat or Solidity ...
As you see below the top 3 processes are running that plugin.
After disabling that plugin, my CPU activities have been reduced dramatically.
I am running on Linux Mint 20.3
please advise. thanks
The text was updated successfully, but these errors were encountered: