This is to make runner compatible with Kubernetes' Karpenter, and in general k8s pod movement . This fixes the https://github.com/actions/runner/issues/3308 by handling graceful shutdown of the runner. It does following.
If the runner is just listening for jobs and Idle, It will just exit.
If the runner is running a job, It will wait RUNNER_GRACEFUL_STOP_TIMEOUT seconds before terminating or job completion whichever happens first.
This is to make runner compatible with Kubernetes' Karpenter, and in general k8s pod movement . This fixes the https://github.com/actions/runner/issues/3308 by handling graceful shutdown of the runner. It does following.
RUNNER_GRACEFUL_STOP_TIMEOUT
seconds before terminating or job completion whichever happens first.