如何解决Celery的ConnectionError: Too many heartbeats missed
?
[2013-02-11 15:15:38,513: ERROR/MainProcess] Error in timer: ConnectionError('Too many heartbeats missed', None, None, None, '')
Traceback (most recent call last):
File "/app/.heroku/python/lib/python2.7/site-packages/celery/utils/timer2.py", line 97, in apply_entry
entry()
File "/app/.heroku/python/lib/python2.7/site-packages/celery/utils/timer2.py", line 51, in __call__
return self.fun(*self.args, **self.kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/celery/utils/timer2.py", line 153, in _reschedules
return fun(*args, **kwargs)
File "/app/.heroku/python/lib/python2.7/site-packages/kombu/connection.py", line 265, in heartbeat_check
return self.transport.heartbeat_check(self.connection, rate=rate)
File "/app/.heroku/python/lib/python2.7/site-packages/kombu/transport/pyamqp.py", line 134, in heartbeat_check
return connection.heartbeat_tick(rate=rate)
File "/app/.heroku/python/lib/python2.7/site-packages/amqp/connection.py", line 837, in heartbeat_tick
raise ConnectionError('Too many heartbeats missed')
ConnectionError: Too many heartbeats missed
web: newrelic-admin run-program gunicorn --workers=2 --worker-class=gevent someapp.wsgi:application
scheduler: newrelic-admin run-program python manage.py celery worker -B -E --maxtasksperchild=1000 --loglevel=WARNING
我认为是相关的:
Django==1.4.3
amqp==1.0.8
billiard==2.7.3.20
celery==3.0.14
gevent==0.13.8
greenlet==0.4.0
kombu==2.5.6
raven==3.1.10
celery==3.0.13
至celery==3.0.14
amqplib
- > amqp
kombu==2.4.8
至kombu==2.5.4
答案 0 :(得分:6)
多久发生一次?
在您的情况下,心跳监视可能无法正常工作。 心跳支持是最近才引入的,因此可能存在错误。 我无法在此处重现这一点,因此我需要更多数据来了解正在发生的事情。
您可以通过设置BROKER_HEARTBEAT=0
来停用心跳。
如果这是一个错误,那么工作人员应该运行良好,但它将无法运行
快速检测断开的连接。无法检测到连接丢失
某些环境中的问题(通常由特定的路由器/防火墙配置引起)