wait for jobs to complete when stopping the runner #202
No reviewers
Labels
No labels
FreeBSD
Kind/Breaking
Kind/Bug
Kind/Chore
Kind/DependencyUpdate
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Windows
linux-powerpc64le
linux-riscv64
linux-s390x
run-end-to-end-tests
run-forgejo-tests
run-multi-platform-tests
No milestone
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
forgejo/runner!202
Loading…
Reference in a new issue
No description provided.
Delete branch "earl-warren/runner:wip-signal"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When receiving a signal (INT or TERM) wait for running jobs to complete instead of terminating them right away.
The new shutdown_timeout configuration setting can be used to force the termination after a grace delay. If not specified or zero it will shutdown immediately, for backward compatibility. It will be the case with existing configuration files or when a configuration file is not specified.
The config.yml created with the generate-config subcommand will however default shutdown_timeout to 3h (same as timeout) because it is likely what a new admin would expect: shutting down waits for jobs to complete and not abort them.
Note to reviewers:
1a8e1028ba44845583fa5ba4238ad3708ec54339708ec543392367d25adfWIP: graceful shutdownto wait for jobs to complete when stopping the runner2367d25adfaf763c6728The default value for the shutdown timeout is the only thing that actually make sense (same as the timeout of jobs). However it makes it a breaking change for whatever scripts expect an immediate stop. I think it is acceptable but I'm not 100% sure.
af763c6728c15caa51e7c15caa51e767a1d83ad767a1d83ad77b6fe77166The implementation was changed to default to terminating immediately if shutdown_timeout is zero or unset. Defaulting to the timeout is a bad idea. Not only is it a breaking change https://code.forgejo.org/forgejo/end-to-end tests that rely on the fact that the runner can be stopped immediately (but that can easily be changed by setting the timeout to 1).
It is also problematic because there is no way to force the runner to stop immediately. Once the runner received the signal, it will stop listening to other signals and the admin will have no choice but to wait it out. Or kill -9 which would force them to manually cleanup leftovers.
cascading-pr updated at actions/setup-forgejo#128
7b6fe77166e02e0fc5f5