Skip to content

[13.x] Introduce WorkerInterrupted event#59848

Merged
taylorotwell merged 5 commits intolaravel:13.xfrom
jackbayliss:13.x-WorkerInterrupted-event
Apr 27, 2026
Merged

[13.x] Introduce WorkerInterrupted event#59848
taylorotwell merged 5 commits intolaravel:13.xfrom
jackbayliss:13.x-WorkerInterrupted-event

Conversation

@jackbayliss
Copy link
Copy Markdown
Contributor

@jackbayliss jackbayliss commented Apr 24, 2026

When a signal arrives from infra, the worker finishes the current job before stopping cleanly so we rely on the WorkerStopping event.

But, a worker is not guaranteed to finish a job before it's killed from infra.

So, my idea of a WorkerInterrupted event is born!

This is basically nice from an observability view.

This complements the Interruptible job stuff, essentially. IE I want to know my workers are being signaled, but the jobs may not need to care. I can then log, call Slack etc when a signal arrives so its no longer guess work

Open to renaming it to WorkerSignaled or something if you prefer :)

No test cause its signals.. but can do a fake test if you want?

I've just done it inline, same as WorkerStopping rather than making an executeX method

I think I've done it in a non-bc way, but also:

image

So forgive me!

@github-actions
Copy link
Copy Markdown

Thanks for submitting a PR!

Note that draft PRs are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@jackbayliss jackbayliss marked this pull request as ready for review April 25, 2026 09:55
@taylorotwell taylorotwell merged commit 6e1783b into laravel:13.x Apr 27, 2026
51 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants