-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Fixes #43866 configurable stop signals for messenger #44305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
use Symfony\Component\Messenger\EventListener\SendFailedMessageToFailureTransportListener; | ||
use Symfony\Component\Messenger\EventListener\StopWorkerOnCustomStopExceptionListener; | ||
use Symfony\Component\Messenger\EventListener\StopWorkerOnRestartSignalListener; | ||
use Symfony\Component\Messenger\EventListener\StopWorkerOnSignalListener; | ||
use Symfony\Component\Messenger\EventListener\StopWorkerOnSigtermSignalListener; | ||
use Symfony\Component\Messenger\Middleware\AddBusNameStampMiddleware; | ||
use Symfony\Component\Messenger\Middleware\DispatchAfterCurrentBusMiddleware; | ||
|
@@ -192,8 +193,9 @@ | |
->tag('kernel.event_subscriber') | ||
->tag('monolog.logger', ['channel' => 'messenger']) | ||
|
||
->set('messenger.listener.stop_worker_on_sigterm_signal_listener', StopWorkerOnSigtermSignalListener::class) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it a BC break? 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't that internal service used by framework itself? how can it be BC-break? |
||
->set('messenger.listener.stop_worker_on_signal_listener', StopWorkerOnSignalListener::class) | ||
->args([ | ||
abstract_arg('signals'), | ||
service('logger')->ignoreOnInvalid(), | ||
]) | ||
->tag('kernel.event_subscriber') | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,5 +1,6 @@ | ||||||
framework: | ||||||
messenger: | ||||||
stop_signals: SIGTERM | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does this have to be plural (a list of signals) instead of just 1 signal?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in case project is used in several envs (docker FPM alpine environment, and classical VMs/bare-metal with supervisor) where signals could be different. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then configure the correct signal for that env. Doesn't make sense (to me) to just fire all the signals. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed with @Warxcell. we should allow multiple signals. |
||||||
routing: | ||||||
'Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\FooMessage': ['sender.bar', 'sender.biz'] | ||||||
'Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\BarMessage': 'sender.foo' | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For lists, you should add
fixXmlConfig