Ben
Ben

Reputation: 5129

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?

Upvotes: 5

Views: 5181

Answers (1)

Mohamed El-Refaie
Mohamed El-Refaie

Reputation: 845

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.

Upvotes: 3

Related Questions