1

我正在使用CeleryAmazon SQS,并且在我的日志中看到了这些负载:

[2013-06-19 19:03:42,890: ERROR/MainProcess] Pool callback raised exception: KeyError('8a8fe51c-b69f-498e-95c1-f037e2f2d4a8',)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/billiard/pool.py", line 129, in safe_apply_callback
    fun(*args)
  File "/usr/local/lib/python2.7/dist-packages/celery/worker/job.py", line 301, in on_accepted
    self.acknowledge()
  File "/usr/local/lib/python2.7/dist-packages/celery/worker/job.py", line 439, in acknowledge
    self.on_ack(logger, self.connection_errors)
  File "/usr/local/lib/python2.7/dist-packages/kombu/transport/base.py", line 98, in ack_log_error
    self.ack()
  File "/usr/local/lib/python2.7/dist-packages/kombu/transport/base.py", line 93, in ack
    self.channel.basic_ack(self.delivery_tag)
  File "/usr/local/lib/python2.7/dist-packages/kombu/transport/SQS.py", line 252, in basic_ack
    delivery_info = self.qos.get(delivery_tag).delivery_info
  File "/usr/local/lib/python2.7/dist-packages/kombu/transport/virtual/__init__.py", line 127, in get
    return self._delivered[delivery_tag]
KeyError: '8a8fe51c-b69f-498e-95c1-f037e2f2d4a8'

我试着用谷歌搜索,似乎没有人真正知道它来自哪里?有人知道发生了什么吗?我注意到一些奇怪的行为,任务失败,然后它一次又一次地重试相同的任务。一段时间后,它不仅会重试,而且甚至不会在日志(或任何日志语句)中显示错误。它只是说它有一个任务,它会尝试它。我不确定发生了什么?

我刚刚使用以下方法进行了清除:

from celery.task.control import discard_all
discard_all()

不知何故,任务又回来了!有人知道这怎么可能吗?

4

1 回答 1

1

这是由 Kombu 的 SQS 后端中的错误引起的,已在https://github.com/celery/kombu/pull/431中修复

于 2019-04-08T22:28:07.593 回答