laravel-queue-rabbitmq
laravel-queue-rabbitmq copied to clipboard
Worker ignores `illuminate:queue:restart` signal
- Laravel version: 8.26.1
- RabbitMQ version: 3
- Package version: 11.1.1
Describe the bug
After calling queue:restart
the worker doesn't stop.
Steps To Reproduce
- Run
php artisan rabbitmq:consume
- Run in different terminal
php artisan queue:restart
Current behavior
Worker ignores restart signal
Expected behavior
Worker should stop when stopIfNecessary()
returns a exit code
Additional context
on https://github.com/vyuldashev/laravel-queue-rabbitmq/blob/master/src/Consumer.php#L142 now the stopIfNecessary()
is called. But the exit code isn't handled. It should break from the while
loop and stop the "deamon"
$this->stopIfNecessary($options, $lastRestart, $this->gotJob ? true : null);
should be changed to:
$status = $this->stopIfNecessary(
$options, $lastRestart, $startTime, $jobsProcessed, $job
);
if (! is_null($status)) {
return $this->stop($status);
}
@vyuldashev same problem. We use systemd for workers, and systemd just killing the process with timeout exception on trying to restart service.
Version 11 of this package is no longer supported. If you are still experiencing the issue with a more recent version, please open a separate issue.