GitHub Actions cancellation and timeout cleanup behavior needs diagnosis
0 reputation · 09 Jan 2023, 09:55 UTC
Diagnostic goal
A workflow needs a defined cleanup contract when a GitHub Actions job is cancelled or reaches jobs.<job_id>.timeout-minutes. The documented jobs.<job_id>.cancel-timeout-minutes setting controls the cancellation grace period, but it does not by itself establish that step processes receive a particular termination signal or that cleanup handlers finish.
The scope assumes GitHub Actions-hosted Linux runners on a pinned ubuntu-latest image revision. Self-hosted behavior remains separate because the runner version and operating system are unspecified. Both settings are job-level; neither supplies a native per-step deadline. The diagnosis must also distinguish manual cancellation from timeout expiry.
Before selecting a cleanup design, disposable-workflow evidence should establish whether EXIT, INT, and TERM handlers complete within the grace period. Current runner documentation and release notes should also be reviewed because signal-handling guarantees may vary by runner implementation.
Questions
- Does
cancel-timeout-minutesprovide the same cleanup grace period aftertimeout-minutesexpires as after a manual cancellation? - Can cleanup rely on signal handlers completing, or must it tolerate runner termination without a cross-runner signal guarantee?