actions / runner

The Runner for GitHub Actions :rocket:
https://github.com/features/actions
MIT License
4.64k stars 892 forks source link

SIGTERM kills the job instead of waiting for job completion #3308

Open jaswanthikolla opened 1 month ago

jaswanthikolla commented 1 month ago

May be this can be a feature request but I don't see any discussions ( of any kind) at here, so not sure where to log it. And also, It's existing functionality too.

Describe the bug In summerwind images, If we receive a SIGTERM the runners waits default 15 mins before killing a running job. With Scaled Sets ( ARSS), helmcharts use ghcr.io/actions/actions-runner images with run.sh entrypoint which lacks the graceful termination functionality. This functionality is expected as consistent between ARC and scaled sets.

To Reproduce Steps to reproduce the behavior:

  1. Launch the Runner with a label.
  2. Run a workflow with the assigned label. Make sure to have a step of bash sleep statement to simulate long running job.
  3. Send SIGTERM signal. On kubernetes send a pod termination signal.
  4. Check if the workflow succeeded or not.

Expected behavior These 2 different behaviors are expected based on running is running the job or not.

Runner Version and Platform

2.316.1

OS of the machine running the runner? Linux - Ubuntu 22

What's not working?

SIGTERM handling

jaswanthikolla commented 2 weeks ago

I am ready to raise a PR for this if https://github.com/actions/runner/issues/3330 can be solved.