5👍
celeryd has –autoreload option. If enabled, celery worker (main process) will detect changes in celery modules and restart all worker processes. In contrast to SIGHUP signal, autoreload restarts each process independently when the current executing task finishes. It means while one worker process is restarting the remaining processes can execute tasks.
http://celery.readthedocs.org/en/latest/userguide/workers.html#autoreloading
3👍
I’ve recently fixed the bug with SIGHUP: https://github.com/celery/celery/pull/662
- [Django]-How to get GET request values in Django?
- [Django]-Django models without database
- [Django]-SQLAlchemy and django, is it production ready?
2👍
rm *.pyc
This causes the updated tasks to be reloaded. I discovered this trick recently, I just hope there are no nasty side effects.
- [Django]-Migrating from django user model to a custom user model
- [Django]-How to reverse the URL of a ViewSet's custom action in django restframework
- [Django]-How to receive POST data in django
1👍
Well you using SIGHUP (1) for warm shutdown of celery. I am not sure if it actually causes a warm shutdown. But SIGINT (2) would cause a warm shutdown. Try SIGINT in place of SIGHUP and then start celery manually in your script (I guess).
- [Django]-How to stop celery worker process
- [Django]-How can I set a default value for a field in a Django model?
- [Django]-How can I modify Procfile to run Gunicorn process in a non-standard folder on Heroku?
0👍
Can you launch it with a custom pid file name. Possibly timestamped, and key off of that to know which PID to kill?
CELERYD_PID_FILE="/var/run/celery/%n_{timestamp}.pid"
^I dont know the timestamp syntax but maybe you do or you can find it?
then use the current system time to kill off any old pids and launch a new one?
- [Django]-Difference between setattr and object manipulation in python/django
- [Django]-How to programmatically call a Django Rest Framework view within another view?
- [Django]-Django select only rows with duplicate field values
0👍
A little late, but that can fixed by deleting the file called celerybeat.pid.
Worked for me.
- [Django]-Getting 'DatabaseOperations' object has no attribute 'geo_db_type' error when doing a syncdb
- [Django]-Django multiprocessing and database connections
- [Django]-PyCharm hangs on 'scanning files to index' background task
0👍
I think you can try this:
kill -s HUP ``cat /var/run/celeryd.pid``
python manage.py celeryd --pidfile=/var/run/celeryd.pid
HUP
may recycle every free worker and leave executing workers keep running and HUP
will let these workers be trusted. Then you can safely restart a new celery worker main process and workers. Old workers may be killed itself when task has been finished.
I’ve use this way in our production and it seems safe now. Hope this can help you!
- [Django]-AttributeError: 'ManyRelatedManager' object has no attribute 'add'? I do like in django website but got this error
- [Django]-URL-parameters and logic in Django class-based views (TemplateView)
- [Django]-Raw SQL queries in Django views