python - Notify celery task to stop during worker shutdown -


i'm using celery 3.x , rabbitmq backend. time time needs restart celery (to push new source code update server). there task big loop , try/catch inside of loop; can takes few hours accomplish task. nothing critical happen if stop , restart later.

question: problem every time after stopped workers (via sudo service celeryd stop) have kill task manually (via kill -9); task ignores sigterm worker. i've read throw celery docs & stackoverflow can't find working solution. ideas how fix problem?

celery not intended run long tasks cause blocks worker task only. recommend re-arranging logic, making task invoke instead of making loop. once shutdown in progress, current task complete , resume right @ same point stopped before celery shutdown.

also, having task split chunks, able divert task worker/host in future.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -