Framing Errors in Celery 3.0.1

江枫思渺然 提交于 2020-01-12 07:52:08

问题


I recently upgraded to Celery 3.0.1 from 2.3.0 and all the tasks run fine. Unfortunately. I'm getting a "Framing Error" exception pretty frequently. I'm also running supervisor to restart the threads but since these are never really killed supervisor has no way of knowing that celery needs to be restarted. Has anyone seen this before?

2012-07-13 18:53:59,004: ERROR/MainProcess] Unrecoverable error: Exception('Framing Error, received 0x00 while expecting 0xce',)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/worker/__init__.py", line 350, in start
    component.start()
  File "/usr/local/lib/python2.7/dist-packages/celery/worker/consumer.py", line 360, in start
    self.consume_messages()
  File "/usr/local/lib/python2.7/dist-packages/celery/worker/consumer.py", line 445, in consume_messages
    drain_nowait()
  File "/usr/local/lib/python2.7/dist-packages/kombu/connection.py", line 175, in drain_nowait
    self.drain_events(timeout=0)
  File "/usr/local/lib/python2.7/dist-packages/kombu/connection.py", line 171, in drain_events
    return self.transport.drain_events(self.connection, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/kombu/transport/amqplib.py", line 262, in drain_events
    return connection.drain_events(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/kombu/transport/amqplib.py", line 97, in drain_events
    chanmap, None, timeout=timeout)
  File "/usr/local/lib/python2.7/dist-packages/kombu/transport/amqplib.py", line 155, in     _wait_multiple
    channel, method_sig, args, content = read_timeout(timeout)
  File "/usr/local/lib/python2.7/dist-packages/kombu/transport/amqplib.py", line 129, in read_timeout
    return self.method_reader.read_method()
  File "/usr/local/lib/python2.7/dist-packages/amqplib/client_0_8/method_framing.py", line 221, in read_method
    raise m
Exception: Framing Error, received 0x00 while expecting 0xce

回答1:


While I am not sure why this actually happens, switching from amqplib to librabbitmq helped me to overcome this trouble.

I haven't changed anything in configuration, just:

pip uninstall amqplib
pip install librabbitmq

And restarted celery workers.

Got this idea form https://github.com/celery/celery/issues/922



来源:https://stackoverflow.com/questions/11479647/framing-errors-in-celery-3-0-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!