-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Bug: sam sync with python causes endless cpu saturation #7058
Comments
Found out that it is triggered by |
Hi @cshenrik thanks for reporting this issue. Are you using any plugin in VSCode which might be changing the file constantly? We are listening to file change events which is published by OS, and we usually drop the ones which doesn't change the file (open event for instance). I've quickly tested the scenario locally, but SAM CLI is not showing a high CPU usage like 100%. |
Hi @mndeveci, |
Running |
@cshenrik I've tried on a linux machine as well, however it doesn't spike the CPU usage. Are there any more details that can help us to re-produce the issue on our side? |
Thanks for pinning the issue. I can see that we bumped the We can add more debug logs to see which event is getting triggered with your setup, and use that information (to see which even is getting triggered and causing high cpu usage) to open an issue on their repo. Would you be able to run a development version of SAM CLI and try that with additional logs? I forgot to ask but how do you install SAM CLI, are you using official installers or an alternative method? |
Sure, I can run a development version. And yes, I use the official installers. |
I've added some logs and also an early return if we receive file open event. Can you pull this branch and test it on your side? https://github.com/mndeveci/aws-sam-cli/tree/add_logs_for_file_watchers You need to create a python virtual environment with python3.11, activate it and run What I've seen so far, we are getting constant file opened event if you do Let me know if this branch fixes issue on your side, we can then move forward and raise a PR for the fix. |
That fixed it! |
Patch is released in v1.118.0. Closing |
Description:
When running
sam sync --watch --region us-east-1
on a python project, thesam sync
process utilizes 100% cpu until I kill it (after at least 30 minutes)Steps to reproduce:
sam deploy --guided
sam sync --watch --region us-east-1
After it has deployed the application and the CPU utilization has gone down, it suddenly goes to 100% and stays there.
Observed result:
The last part of the output from
sam sync
:Paste the output of
sam --info
hereThe text was updated successfully, but these errors were encountered: