Post job hook is not triggered when Runner is shutdown
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 1.4k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 24
Description
Describe the bug
Seems that Runner skips the Complete Runner step when the SystemD service is stopped during job processing. This behaviour is different from when user cancels the workflow using GitHub UI.
To Reproduce
Steps to reproduce the behavior:
- Define post job hook via
ACTIONS_RUNNER_HOOK_JOB_COMPLETED - Start ephemeral runner as SystemD service
- Schedule job for this runner
- Stop the service using
./svc.sh uninstallwhile job is being processed by the runner - See that
Complete Runnerstep was skipped in the Workflow Run
Expected behavior
The Complete Runner step is part of shutdown procedure same as Complete Job step.
Runner Version and Platform
Version of your runner?
v2.304.0
OS of the machine running the runner? Linux
What's not working?
Result when stopping the system service:
Result when User cancels via GitHub UI:
In both cases the step results with the same error:
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the runner shutdown path used when ./svc.sh uninstall stops the SystemD service, and compare it with the cancellation path that runs Complete Job. Reproduce the issue with ACTIONS_RUNNER_HOOK_JOB_COMPLETED on an ephemeral Linux runner. Done means the post-job hook runs during service shutdown as it does when the workflow is cancelled through the GitHub UI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, github-actions, linux
- Domain
- ci-cd, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100