-
Notifications
You must be signed in to change notification settings - Fork 881
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
safe_sleep.sh inadvertently top 100% CPU #2380
Comments
Thanks @leleobhz, labeled the issue.
This barebones implementation for A better 'safe sleep' must
A good start would be to check for the existence of such utils before resorting to the above CPU intensive counting |
Hey @fhammerl, was this bug fixed? We have runners in ASG that scales to MAX because of this script. |
@LiranBarton hello! This script as far I understood the reasons aims to have a minimal Main questions here is this implementation lead's to CPU ocupation and may be uses only if sleep are not present on system, as last fallback. I suggest this way to handle sleep() issues if it's really needed (But personally I can't see why sleep does need a pure-shell implementation here since we have both bash or busybox that someway implement this function. Also, maybe embed busybox a better solution instead custom implementation). |
Just a note, the above fix wasn't permanent because the actions runner seems to automatically update over time and pulls the original A snippet of the runner logs, where it performs a update from 2.299.1 to 2.305.0.
My
Edit: |
There are already a bunch of binaries bundled with the runner, e.g. |
Describe the bug
safe_sleep.sh is built as while loop aiming to be safer than count on sleep or ping binaries. While loop the way function was implemented leads to 100% CPU usage without try another alternatives (Eg. Testing if sleep is available).
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A lesser CPU usage from runner while idle.
Actual behavior
Runner Version and Platform
Linux 2.300.2 running on Docker.
The text was updated successfully, but these errors were encountered: