Skip to content

Add SIGQUIT to the preStop hook

Oscar Medina requested to merge oscar.medina2/gitlab-runner:main into main

What does this MR do?

It adds a SIGQUIT to the preStop hook. This way, the runner will wait until all its jobs are finished before exiting.

Why was this MR needed?

Without it, in some situations, jobs were left isolated and never report back to GitLab, and those jobs continued to exist after completion leading to exciting autoscaling and resource leaks.

What's the best way to test this MR?

The easiest way to test this MR is to delete a runner pod when it has jobs running. The outcome will be.

  • The runner stops receiving jobs.
  • The runner stays actively monitoring the running jobs.
  • When all the assigned jobs finish, the runner will stop, and the pod will be removed.

What are the relevant issue numbers?

This fix has been introduced to fix an unexpected behavior we started noticing when fixing this issue through workarounds. #22088

Merge request reports

Loading