130nrd
130nrd

Reputation: 180

Supervisorctl does not auto-restart daemon queue worker when hanging

I have supervisorctl managing some daemon queue workers with this configuration :

[program:jobdownloader]
process_name=%(program_name)s_%(process_num)03d
command=php /var/www/microservices/ppsatoms/artisan queue:work ppsjobdownloader --daemon --sleep=0
autostart=true
autorestart=true
user=root
numprocs=50
redirect_stderr=true
stdout_logfile=/mnt/@@sync/jobdownloader.log

Sometimes some workers are like hanging (running but stop getting queue messages) and supervisorctl does not automatically restart them, so I have to monitor and manually restart them.

Is there something wrong with the configuration? What can I do to prevent this to happen in the future?

Upvotes: 1

Views: 2417

Answers (1)

130nrd
130nrd

Reputation: 180

Update :

Run the process as normal process (non-daemon) so that supervisorctl can restart the workers after they signal exit code :

[program:jobdownloader]
process_name=%(program_name)s_%(process_num)03d
command=php /var/www/microservices/ppsatoms/artisan queue:work ppsjobdownloader --sleep=0
autostart=true
autorestart=true
user=root
numprocs=50
redirect_stderr=true
stdout_logfile=/mnt/@@sync/jobdownloader.log

Upvotes: 1

Related Questions