Repository navigation
Conversation
If Runner.Worker fails to start (for example when blocked by an application control policy such as Windows Smart App Control), the launch exception was captured in the faulted worker task. The listener then failed to send the job message, the exception escaped RunAsync without completing the job request, and lock renewal kept running, so the job stayed in progress with zero steps. Behind the actions_runner_fail_job_on_worker_launch_failure feature flag, detect the faulted launch, report an error issue/annotation, stop lock renewal and complete the job as failed.
salmanmkc
force-pushed
the
salmanmkc-fail-job-on-worker-launch-error
branch
from
October 16, 2026 19:12
7dd646f to
c241814
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When
Runner.Workercan't be started at all (e.g. it's blocked by an application control policy such as Windows Smart App Control, Code Integrity event 3077), the job is left assigned and in progress with zero steps until it's cancelled manually.Root cause in
JobDispatcher.RunAsync:ProcessInvoker.ExecuteAsyncisasync, so theWin32ExceptionfromProcess.Startis captured in a faultedworkerProcessTaskrather than thrown.OperationCanceledException, which isn't handled.RunAsyncwithout callingCompleteJobRequestAsyncand without cancellinglockRenewalTokenSource. Disposing the CTS doesn't cancel it, so the lock keeps being renewed every 60s and the service thinks the job is still running.Fix
Behind a new feature flag
actions_runner_fail_job_on_worker_launch_failure, afterStartServerthe listener checks whether the worker task has already faulted. If so it:The runner failed to start the worker process 'Runner.Worker': <reason>JobCompletedEvent(Failed)for classic jobs, orCompleteJobAsync(Failed)with an error annotation for run-service jobsFailedThe issue is tagged with a new internal telemetry value
WORKER_LAUNCH_FAILURE.Tests
Three L0 tests in
JobDispatcherL0simulate a launchWin32Exception:Failed, the job message is never sent, lock renewal stops, the job timeline record is marked failed with the launch error issue (taggedWORKER_LAUNCH_FAILURE), and a failedJobCompletedEventis raisedCompleteJobAsync(Failed)with an annotation containing the launch errorManual end-to-end test
Built the runner layout from this branch (osx-arm64), registered it as a self-hosted runner on a test repo, and made
bin/Runner.Workernon-executable (chmod -x) to simulate the launch being blocked.in_progresswith 0 steps; listener keeps renewing the lock every 60s; a normal cancel does not complete it, and the runner can't pick up the next queued job until the stuck run is force-cancelled.failurewithin ~1s with the annotationThe runner failed to start the worker process 'Runner.Worker': An error occurred trying to start process '.../bin/Runner.Worker' ... Permission denied; lock renewal stops.chmod +x, the same runner picked up the next job and it succeeded.Notes for reviewers
DispatchesJobRequest/DispatchesOneTimeJobRequesttests throw early on an unregisteredIJobNotificationsingleton and pass vacuously. Not changed here.actions_runner_fail_job_on_worker_launch_failureas a job variable for this to take effect. Until then it's a no-op.