Issue
While issuing a new build to update code in workers how do I restart celery workers gracefully?
Edit: What I intend to do is to something like this.
- Worker is running, probably uploading a 100 MB file to S3
- A new build comes
- Worker code has changes
- Build script fires signal to the Worker(s)
- Starts new workers with the new code
- Worker(s) who got the signal after finishing the existing job exit.
Solution
According to http://ask.github.com/celery/userguide/workers.html#restarting-the-worker you can restart a worker sending a HUP signal
ps auxww | grep celeryd | grep -v "grep" | awk '{print $2}' | xargs kill -HUP
Answered By - armonge
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.