actions / actions/runner

safe_sleep.sh inadvertently top 100% CPU

Open
#2,380 7 comments 18 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good-first-issue keep
Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

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:

  1. Start runner
  2. Wait

Expected behavior

A lesser CPU usage from runner while idle.

Actual behavior

image

Runner Version and Platform

Linux 2.300.2 running on Docker.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating safe_sleep.sh and inspect the while loop used while the runner is idle. Reproduce the behavior with the Linux runner in Docker, then verify that an idle runner no longer reaches 100% CPU while preserving the safer sleep behavior described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
ci-cd
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.