admin管理员组文章数量:1291998
i want to reproduce this behaviour highlighted in celery doc
If the worker won’t shutdown after considerate time, for being stuck in an infinite-loop or similar, you can use the KILL signal to force terminate the worker: but be aware that currently executing tasks will be lost (i.e., unless the tasks have the acks_late option set).
this is my task:
@shared_task(
name='CHECK_ACK',
acks_late=True,
)
def check_ack():
print('task picked')
time.sleep(60)
print('task completed after 60r seconds')
here are steps i am following:
1.start celery: celery -A master worker --concurrency=2
2.run the task from django shell: check_ack.delay()
3. while task is running execute :pkill -9 -f 'master worker'
4. now restart celery again : celery -A master worker --concurrency=2
But i don't see the task getting re-picked by workers. What am i missing?
本文标签: djangosetting ackslateTrue doesnt reexecute the task if worker process is killedStack Overflow
版权声明:本文标题:django - setting acks_late=True doesnt re-execute the task if worker process is killed - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741542782a2384419.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论