Configurable step cancellation grace period (e.g. env var or runner setting) #188186
Replies: 3 comments
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
Great feedback! The 10-second cancellation window is definitely too short for tools like Terraform that need time to release state locks cleanly. Of your three options, Option C (workflow-level cancel-grace-period) seems the safest since it doesn't affect existing workflows and lets teams opt in only where needed. Hope GitHub prioritizes this — stuck state locks are a real headache! 👍 |
Beta Was this translation helpful? Give feedback.
-
|
Agreed—10 seconds is often too short for safely cleaning up resources. A configurable cancel-grace-period at the workflow level would be a practical, low-impact solution. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Why are you starting this discussion?
Product Feedback
What GitHub Actions topic or product is this about?
General
Discussion Details
Configurable step cancellation grace period
Summary
When a workflow run is cancelled, the runner uses a fixed sequence to stop the step process: it sends SIGINT, then after 7.5 seconds sends SIGTERM, then after another 2.5 seconds kills the process tree (Workflow cancellation reference). So the step has about 10 seconds to shut down.
We need a longer grace period (e.g. 120 seconds) so that steps like
terraform applycan release state locks and exit cleanly when a run is cancelled. Right now, if Terraform doesn’t finish within ~10 seconds, the process is killed and the state lock can be left stuck, requiring manualterraform force-unlock.Proposed solution
Add a supported way to configure the step cancellation grace period. For example:
Option A – Environment variable (e.g. on the runner or job):
ACTIONS_STEP_CANCEL_GRACE_SECONDS=120(or an equivalent name, e.g.
ACTIONS_CANCEL_GRACE_MSin milliseconds).Option B – Runner configuration (e.g. in
.runneror runner config):StepCancelGraceSeconds = 120that the runner reads at startup.Option C – Workflow-level setting (e.g. in the job):
cancel-grace-period: 120(seconds) so only jobs that need it opt in.If the variable/setting is unset or invalid, keep the current behaviour (7.5s + 2.5s).
Why it matters
References
Thanks for considering this.
Beta Was this translation helpful? Give feedback.
All reactions