Repository navigation
Fix worker being killed 15s after a job calls Artisan::call() - #4
Merged
tevkert merged 2 commits intoNov 19, 2026
Merged
Conversation
The exit watchdog listener is shared by Horizon's forked workers and plain queue:work workers, so the same job killed a queue:work worker 15 s after its Artisan::call(). The test fails on main and passes with the fix.
Owner
|
Thanks Ali, great catch and a very clear write-up. You're right: I reproduced it and pushed one commit on top of yours:
The Horizon and |
tevkert
added a commit
that referenced
this pull request
Nov 19, 2026
A job that calls Artisan::call() and keeps working past exit_grace no longer gets its worker killed: the exit watchdog is armed when the console kernel terminates instead of on CommandFinished (#4). CHANGELOG for 1.1.1.
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.
A job that calls
Artisan::call()and then keeps working for more than 15 seconds gets its worker killed mid-job. Stock workers are fine.The exit watchdog is armed on
CommandFinished, and Laravel fires that forArtisan::call()too. So the watchdog starts counting inside the job and replaces the worker's own SIGALRM timeout handler. 15s later the worker dies. The job isn't marked failed, it just runs again afterretry_after.To reproduce:
The fix: arm the watchdog from the console kernel's
terminate()instead. Laravel only calls that once, after the command the process was started for.Artisan::call()never gets there. On Laravel 11.18+ that's theTerminatingevent, on older 11.x it's$app->terminating().Added a
calls-artisanfixture and a test inStockParityTest. It times out on main and passes here. Unit, Mechanics and the Integration suite (host mode) pass.I haven't run the older-Laravel fallback on a real 11.0 install, only read the kernel code for it.