Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will supervisor gracefully restart all of the queue workers if supervisorctl reload / restart?

When this command php artisan queue:restart run, all of the queue workers are gracefully restarted.

But, if these commands supervisorctl reload or supervisorctl restart run, what the commands run behind? Will they kill the queue workers forcefully and start the workers again?

Sometimes, when the supervisor config is changed, supervisor need to reload and restart.

If supervisor does not start the queue workers gracefully, any workaround so that it won't kill the workers forcefully, so that I do not need to do some cleanup?

like image 417
Ben Avatar asked Nov 08 '22 09:11

Ben


1 Answers

Using Supervisor reload or restart command as of Laravel 5.4+ will instruct the queue worker to do a graceful shutdown.

But, make sure your supervisor does not kill the worker before the worker attempts to graceful shutdown by setting "stopwaitsecs" in your supervisor config file to a value higher than the estimated job processing time.

like image 107
Mohamed El-Refaie Avatar answered Nov 15 '22 11:11

Mohamed El-Refaie