Celery 任务重试(Celery、Django 和 RabbitMQ)
你能告诉我当你在芹菜中告诉任务重试时发生了什么吗?它会在同一个工作线程中重试,还是会返回到代理,代理可能会将其发送到其他地方?
如果工作人员或调度员突然停止,重试任务会发生什么情况?如果任务可能丢失,是否有一些方法可以避免这种情况?是否可以将每个任务保存在数据库中,如果一段时间没有收到结果则重试?
或者调度程序可能有自己的持久存储?如果工作线程在接收任务或执行任务时崩溃怎么办?
Can you tell me what is happening when in celery you tell the task to retry? Will it retry in the same worker thread or it will be returned to broker which may send it elsewhere?
What will happen with tasks for retry if worker or dispatcher suddenly stop? If tasks can be lost is there some approach to avoid this? May be save each task in database and retry them if no result is received for some time?
Or may be dispatcher have it's own persistent storage? What about then if worker thread crash receiving the task or while executing it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,任务以不同的估计执行时间返回到代理(例如 Rabbit MQ)
这里有一个完整的答案 重试丢失或失败的任务(Celery、Django 和RabbitMQ)
Yes the task return to the broker (ex. Rabbit MQ) with a different estimated execution time
Here a complete answer Retry Lost or Failed Tasks (Celery, Django and RabbitMQ)