title: How to restart celery using supervisord?
body: <p>I have celery running in production environment. Whenever I change the code and restart the celery worker, it takes 15-20 minutes just to receive tasks. A lot of tasks gets registered as follow.</p>
  <p><code>[2020-06-22 04:12:10,831: INFO/MainProcess] Received task: app.tasks.task1[61aa7bf0-6b86-4d18-8faa-7354fda1f5e7]  ETA:[2020-06-22 23:37:16.413708+05:30]</code></p>
  <p>Basically these are tasks that needs to be run at a later time, but it does slow down the complete restart of celery process as there are a lot of task to be run at later time. Is there a way to avoid this?</p>
  <p>One thing that has worked for me in case of prefork is sending the <code>HUP</code> signal to child worker processes, but what will I do in case of <code>eventlet</code>. Also, is it even the right way to do it that is by sending <code>HUP</code> signal to child processes?</p>
  <p>My <code>supervisord</code> celery config is as follow:</p>
  <pre><code>[program:celeryd]
  environment=DJANGO_SETTINGS_MODULE=proj.settings.celery
  command=venv/bin/celery -A proj.celery worker -l info
  stdout_logfile=/var/logs/celeryd_out.log
  stderr_logfile=/var/logs/celeryd_err.log
  autostart=true
  autorestart=true
  startsecs=3
  stopwaitsecs=600
  stopasgroup=true
  stopsignal=KILL
  </code></pre>