diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 3f7ef041935c9..87eb7a6c262c0 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -97,7 +97,7 @@ public function __construct( $this->defaultCommand = 'list'; if (\defined('SIGINT') && SignalRegistry::isSupported()) { $this->signalRegistry = new SignalRegistry(); - $this->signalsToDispatchEvent = [\SIGINT, \SIGTERM, \SIGUSR1, \SIGUSR2]; + $this->signalsToDispatchEvent = [\SIGINT, \SIGQUIT, \SIGTERM, \SIGUSR1, \SIGUSR2]; } } @@ -984,7 +984,7 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI if (Terminal::hasSttyAvailable()) { $sttyMode = shell_exec('stty -g'); - foreach ([\SIGINT, \SIGTERM] as $signal) { + foreach ([\SIGINT, \SIGQUIT, \SIGTERM] as $signal) { $this->signalRegistry->register($signal, static fn () => shell_exec('stty '.$sttyMode)); } } diff --git a/src/Symfony/Component/Messenger/CHANGELOG.md b/src/Symfony/Component/Messenger/CHANGELOG.md index c2abf7a63e83e..24cd1c9332e27 100644 --- a/src/Symfony/Component/Messenger/CHANGELOG.md +++ b/src/Symfony/Component/Messenger/CHANGELOG.md @@ -7,6 +7,7 @@ CHANGELOG * Add option `redis_sentinel` as an alias for `sentinel_master` * Add `--all` option to the `messenger:consume` command * Add parameter `$jitter` to `MultiplierRetryStrategy` in order to randomize delay and prevent the thundering herd effect + * Add `SIGQUIT` signal among list of signals that gracefully shut down `messenger:consume` and `messenger:failed:retry` commands 7.0 --- diff --git a/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php b/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php index 2e6e1247ae388..79dd5d617c500 100644 --- a/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php +++ b/src/Symfony/Component/Messenger/Command/ConsumeMessagesCommand.php @@ -264,7 +264,7 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti public function getSubscribedSignals(): array { - return $this->signals ?? (\extension_loaded('pcntl') ? [\SIGTERM, \SIGINT] : []); + return $this->signals ?? (\extension_loaded('pcntl') ? [\SIGTERM, \SIGINT, \SIGQUIT] : []); } public function handleSignal(int $signal, int|false $previousExitCode = 0): int|false diff --git a/src/Symfony/Component/Messenger/Command/FailedMessagesRetryCommand.php b/src/Symfony/Component/Messenger/Command/FailedMessagesRetryCommand.php index a2a8034aad150..762b225984417 100644 --- a/src/Symfony/Component/Messenger/Command/FailedMessagesRetryCommand.php +++ b/src/Symfony/Component/Messenger/Command/FailedMessagesRetryCommand.php @@ -50,7 +50,7 @@ public function __construct( private EventDispatcherInterface $eventDispatcher, private ?LoggerInterface $logger = null, ?PhpSerializer $phpSerializer = null, - private ?array $signals = null + private ?array $signals = null, ) { parent::__construct($globalReceiverName, $failureTransports, $phpSerializer); } @@ -132,7 +132,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int public function getSubscribedSignals(): array { - return $this->signals ?? (\extension_loaded('pcntl') ? [\SIGTERM, \SIGINT] : []); + return $this->signals ?? (\extension_loaded('pcntl') ? [\SIGTERM, \SIGINT, \SIGQUIT] : []); } public function handleSignal(int $signal, int|false $previousExitCode = 0): int|false