Skip to content
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

artisan queue restart does not restart the queue #21251

Closed
wotta opened this issue Sep 19, 2017 · 4 comments
Closed

artisan queue restart does not restart the queue #21251

wotta opened this issue Sep 19, 2017 · 4 comments

Comments

@wotta
Copy link

wotta commented Sep 19, 2017

  • Laravel Version: 5.4.36
  • PHP Version: 7.0.20
  • Database Driver & Version: MySQL 5.6.35

Description:

We are using a queue worker to convert pdf files to a image which normally runs fine, but the moment we deploy our project and we need to restart the queue worker it doesn't work.

it does not restart the queue worker which means our queue is not being processed anymore.

We have looked through some of the issue's on github but we did not find any solution.

We managed to hardkill the queue worker process with the following command : kill -9 {PID ID} but this isn't iddeal.

Steps To Reproduce:

  1. Run one of the following commands : ps aux | grep queue:work (mac) or ps faux | grep queue:work (linux)
  2. Make sure a queue worker is running : artisan queue:work --deamon.
  3. Open a new terminal window and run the following command artisan queue:restart.
  4. Check if the queue process is still active with one of the commands at ( point number 1 ).
@themsaid
Copy link
Member

Can't replicate, calling artisan queue:restart kills the process if no jobs are running, if a job is running the process won't die unless the worker finishes whatever jobs its working on.

@sisve
Copy link
Contributor

sisve commented Sep 19, 2017

Your issue is unclear. Are you reporting that it doesn't start up again, or that it doesn't stop at all?

The name of queue:restart does indeed suggest an actual restart, but that isn't what it does. It only stops processing jobs, and expect a process manager like supervisor or systemd to start it again.

Internally queue:restart sets a flag in the cache that tells all workers that sees it to restart. This means that your workers need to use the cache that the artisan command is using. It also means that it will restart all workers that uses the same cache, in case of a shared redis/memcached setup and several workers.

The documentation under Queues > Supervisor Configuration has an example setup.

@themsaid
Copy link
Member

Given:

We managed to hardkill the queue worker process with the following command : kill -9 {PID ID} but this isn't iddeal.

I assumed the issue is that it doesn't kill the worker process, and yes it won't if the process is busy.

@jafar690
Copy link

@wotta try changing the cache driver to redis

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

No branches or pull requests

4 participants