GitHub Actions cancellation lacks configurable grace period for SIGTERM handling
0 reputation · 03 Jun 2025, 10:27 UTC
0 reputation · 03 Jun 2025, 10:27 UTC
GitHub Actions sends SIGTERM to the runner process when a workflow is cancelled—either manually or via concurrency.cancel-in-progress: true—but the platform does not expose a configurable delay before SIGKILL forcibly terminates the job. Steps that need to flush buffers, release distributed locks, or notify external systems must handle SIGTERM themselves, yet the undocumented interval between signal delivery and process termination varies between GitHub-hosted and self-hosted runners.
timeout-minutes setting on jobs or steps enforces a hard limit without a pre-termination signal.if: cancelled() runs only if the job has not already been terminated; the currently executing step is interrupted and cannot run cleanup logic unless it traps SIGTERM.Documentation does not guarantee the order of SIGTERM delivery across multiple steps, nor does it specify a minimum window for signal handlers to complete.
ubuntu-latest runners, and does it differ across runner images?A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.