我正在使用 git repo https://github.com/celery/librabbitmq的最新主分支,并按照自述文件中的说明安装librabbitmq==2.0.0
Python 3.6
使用开发版本
您可以通过执行以下操作克隆存储库:
$ git clone git://github.com/celery/librabbitmq.git
然后通过执行以下操作安装它:
$ cd librabbitmq
$ make install # or make develop
这工作正常(在操作系统中安装某些二进制文件以进行 c 编译之后),但是当我随后制作一个小的a+b
添加任务并使用它调用它add.delay(2,2)
时失败并出现以下错误。抬头一看,Celery 4 使用 json 作为序列化器,所以显然不是因为如果 pickle 序列化
- 从 librabbitmq 更改为 pyamqp 代理工作正常
- MacOS 和 Ubuntu 16 中的完全相同的情况
[2018-04-30 23:40:02,956: CRITICAL/MainProcess] 不可恢复的错误:SystemError('返回了带有错误集的结果',)回溯(最近一次调用):文件“/Users/somghosh/.virtualenvs/ ctdb/lib/python3.6/site-packages/kombu/messaging.py",第 624 行,在 _receive_callback 中返回 on_m(message) if on_m else self.receive(decoded, message) File "/Users/somghosh/.virtualenvs/ ctdb/lib/python3.6/site-packages/celery/worker/consumer/consumer.py”,第 570 行,在 on_task_received 回调中,文件“/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site- packages/celery/worker/strategy.py”,第 145 行,task_message_handler 句柄(req)文件“/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/worker/worker.py” ,第 221 行,在 _process_task_sem 返回 self._quick_acquire(self._process_task, req) 文件“/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/kombu/async/semaphore.py”,第 62 行,在获取回调中(*partial_args, **partial_kwargs) 文件“/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/worker/worker.py”,第 226 行,在 _process_task req.execute_using_pool(self.池)文件“/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/worker/request.py”,第 531 行,在 execute_using_pool correlation_id=task_id,文件“/Users/somghosh/. virtualenvs/ctdb/lib/python3.6/site-packages/celery/concurrency/base.py”,第 155 行,在 apply_async **options) 文件“/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/billiard/pool.py”,第 1486 行,在 apply_async self._quick_put((TASK, (result._job, None, func, args, kwds))) 文件“/Users/somghosh/.virtualenvs/ ctdb/lib/python3.6/site-packages/celery/concurrency/asynpool.py",第 813 行,在 send_job body = dumps(tup, protocol=protocol) TypeError: can't pickle memoryview objects
上述异常是以下异常的直接原因:
Traceback(最近一次调用最后):文件“/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/worker/worker.py”,第 203 行,在 start self.blueprint.start( self) 文件“/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/bootsteps.py”,第 119 行,在 start step.start(parent) 文件“/Users/somghosh/. virtualenvs/ctdb/lib/python3.6/site-packages/celery/bootsteps.py”,第 370 行,在开始返回 self.obj.start() 文件“/Users/somghosh/.virtualenvs/ctdb/lib/python3. 6/site-packages/celery/worker/consumer/consumer.py”,第 320 行,在 start blueprint.start(self) 文件“/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/ celery/bootsteps.py",第 119 行,在 start step.start(parent) 文件中"/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/worker/consumer/consumer.py”,第 596 行,在 start c.loop(*c.loop_args()) 文件中“/ Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/celery/worker/loops.py”,第 88 行,在 asynloop next(loop) 文件中“/Users/somghosh/.virtualenvs/ctdb/lib /python3.6/site-packages/kombu/async/hub.py”,第 354 行,在 create_loop cb(*cbargs) 文件“/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/ kombu/transport/base.py”,第 236 行,on_readable 阅读器(循环)文件“/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/kombu/transport/base.py”,行218、在_read drain_events(timeout=0)文件“/Users/somghosh/.virtualenvs/ctdb/lib/python3.6/site-packages/librabbitmq-2.0.0-py3.6-macosx-10.6-intel.egg/librabbitmq/init .py",第 227 行,在 drain_events self._basic_recv(timeout) SystemError:返回带有错误集的结果