简体   繁体   English

在RabbitMQ重新启动时丢失芹菜撤销

[英]Celery revocations are lost on rabbitMQ restart

We're using celery eta tasks to schedule tasks FAR (like months) in the future. 我们正在使用celery eta任务来计划将来的任务FAR(例如几个月)。 Now using the rabbitMQ backend because the mongo backend did loose such tasks on a worker restart. 现在使用RabbitMQ后端,因为mongo后端在工作者重启时确实释放了此类任务。

Actually tasks with the rabbitMQ backend seem to be persistent across celery and rabbitMQ restarts, BUT revoke messages seem to be lost on rabbitMQ restarts. 实际上,使用rabbitMQ后端的任务似乎在整个芹菜中是持久的,并且rabbitMQ重新启动,但是在rabbitMQ重新启动时似乎丢失了撤消消息。 I guess that if revoke messages are lost, those eta tasks that should be killed will execute anyway. 我猜想,如果吊销消息丢失了,那些应该被杀死的eta任务仍然会执行。

This may be helpful from the documentation ( Persistent Revokes ): 这可能对文档有所帮助( Persistent Revokes ):

The list of revoked tasks is in-memory so if all workers restart the list of revoked ids will also vanish. 撤消任务的列表在内存中,因此,如果所有工作人员都重新启动,则撤消ID的列表也将消失。 If you want to preserve this list between restarts you need to specify a file for these to be stored in by using the –statedb argument to celery worker: 如果要在两次重新启动之间保留此列表,则需要使用celery worker的–statedb参数指定一个文件来存储这些文件:

$ celery -A proj worker -l info --statedb=/var/run/celery/worker.state

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM