Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I automatically reload tasks modules with Celery daemon?
    primarykey
    data
    text
    <p>I am using Fabric to deploy a Celery broker (running RabbitMQ) and multiple Celery workers with <code>celeryd</code> daemonized through <code>supervisor</code>. I cannot for the life of me figure out how to reload the <code>tasks.py</code> module short of rebooting the servers.</p> <hr> <p><strong>/etc/supervisor/conf.d/celeryd.conf</strong></p> <pre><code>[program:celeryd] directory=/fab-mrv/celeryd environment=[RABBITMQ crendentials here] command=xvfb-run celeryd --loglevel=INFO --autoreload autostart=true autorestart=true </code></pre> <hr> <p><strong>celeryconfig.py</strong></p> <pre><code>import os ## Broker settings BROKER_URL = "amqp://%s:%s@hostname" % (os.environ["RMQU"], os.environ["RMQP"]) # List of modules to import when celery starts. CELERY_IMPORTS = ("tasks", ) ## Using the database to store task state and results. CELERY_RESULT_BACKEND = "amqp" CELERYD_POOL_RESTARTS = True </code></pre> <hr> <p><strong>Additional information</strong></p> <ul> <li><code>celery --version</code> 3.0.19 (Chiastic Slide)</li> <li><code>python --version</code> 2.7.3</li> <li><code>lsb_release -a</code> Ubuntu 12.04.2 LTS</li> <li><code>rabbitmqctl status</code> ... 2.7.1 ...</li> </ul> <hr> <p><strong>Here are some things I have tried:</strong></p> <ul> <li>The <code>celeryd --autoreload</code> flag</li> <li><code>sudo supervisorctl restart celeryd</code></li> <li><code>celery.control.broadcast('pool_restart', arguments={'reload': True})</code></li> <li><code>ps auxww | grep celeryd | grep -v grep | awk '{print $2}' | xargs kill -HUP</code></li> </ul> <p>And unfortunately, nothing causes the workers to reload the tasks.py module (e.g. after running <code>git pull</code> to update the file). <strong>The gist of the relevant fab functions is available <a href="https://gist.github.com/pztrick/5713866">here</a>.</strong></p> <p>The brokers/workers run fine after a reboot.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload