开发者

Celery - collision of task_ids

开发者 https://www.devze.com 2023-02-25 09:19 出处:网络
I\'m getting HardTimeLimit exception for my tasks. After log examination i found - 开发者_如何学Go

I'm getting HardTimeLimit exception for my tasks. After log examination i found -

    开发者_如何学Go
  1. task is not being received by celery ( No "Got task from broker:" message for task id)
  2. task with the same id was executed couple a days ago.

Task ids are assigned automatically by @task decorator, tasks are started by django, there are ~2k tasks per day ( and ~30 collisions per day).

How ID's collision is possible? How to prevent it.


It shouldn't be possible and even if, it should be very rare. My guess would be that the same task is executed a second time after your exception. Maybe there is a problem with your routing keys as the worker doesn't get the task? Or the broker has a problem, I've seen funny problems with RabbitMQ. Deleting it's database (RABBITMQ_MNESIA_BASE) helped in my case.

0

精彩评论

暂无评论...
验证码 换一张
取 消