actions / actions/runner

The linux runner does not gracefully shutdown on SIGINT

Open
#2,582 29 comments 22 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
According to https://github.com/actions/runner/issues/2190#issuecomment-1273302389, the runner should wait for the job is finished and then stop. But it doesn't happen, and new tasks are assigned to the runner with an old PID.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a runner with a running job and execute pgrep -af Runner.Listener
  2. Remember it and execute pkill -INT Runner.Listener
  3. Wait for a one task finished, and another one is started on the same runner.
  4. The pgrep -af Runner.Listener does not change/is still there
  5. The pkill -INT run.sh does not work as well

Expected behavior
The runner should gracefully shutdown. If it does not by SIGINT, there must be another way to stop it right after the job is finished, before assigning a new one

Runner Version and Platform

Linux 2.298.2 amd64

What's not working?

Please include error messages and screenshots.

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

Reproduce the issue on a Linux runner using the listed pgrep and pkill commands against Runner.Listener and run.sh. Trace the runner's shutdown behavior while a job is active; done means SIGINT prevents another task from being assigned and the runner exits after the current job finishes, or a documented alternative stop mechanism works.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, linux
Domain
ci-cd, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.