Skip to content

Stop worker on SIGINT as well as SIGTERM - #55

Merged
DavidBadura merged 1 commit into
1.6.xfrom
stop-on-sigint
Oct 2, 2026
Merged

DavidBadura merged 1 commit into
1.6.xfrom
stop-on-sigint

Conversation

@DavidBadura

Copy link
Copy Markdown
Member

Pressing Ctrl+C killed the worker in the middle of a job, since only SIGTERM was handled. This adds a StopWorkerOnSignalListener that stops the worker on SIGTERM and SIGINT by default and accepts a custom list of signals. create() now uses it, and StopWorkerOnSigtermSignalListener is deprecated.

The default signals are resolved when the worker starts instead of in the constructor, because the SIG* constants don't exist without ext-pcntl and create() always instantiates the listener.

In the docs the "Graceful shutdown on SIGTERM" section is now just "Graceful shutdown", so the anchor changes from #graceful-shutdown-on-sigterm to #graceful-shutdown. README and introduction links are updated.

Pressing Ctrl+C killed the worker in the middle of a job. The new
StopWorkerOnSignalListener handles SIGTERM and SIGINT by default and can
be configured with other signals. create() uses it instead of
StopWorkerOnSigtermSignalListener, which is now deprecated.
@DavidBadura DavidBadura added this to the 1.6.0 milestone Oct 2, 2026
@DavidBadura DavidBadura added the enhancement New feature or request label Oct 2, 2026
@DavidBadura
DavidBadura merged commit de622b4 into 1.6.x Oct 2, 2026
15 of 16 checks passed
@DavidBadura
DavidBadura deleted the stop-on-sigint branch October 2, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants