为什么我的 Celery 远程控制功能挂起?

问题描述

我正在尝试使用 Celery 的远程控制功能来撤销任务。大多数情况下,我尝试使用 app.control.revoke(task_id)函数只是挂起而不会产生结果。有几次它可以工作,但有 95% 的时间会挂起。 app.control.ping

也是如此

我在 Heroku 上使用 Celery 4.2.1 版和 Kombu 4.6.8(尝试将 Kombu 升级到 4.6.11,没有任何更改)和 cloudamqp for RabbitMQ。

有关我执行键盘转义时的堆栈跟踪,请参见下文。

  File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/commands/shell.py",line 69,in handle
    self.run_shell(shell=options['interface'])
  File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/commands/shell.py",line 61,in run_shell
    raise ImportError
ImportError

During handling of the above exception,another exception occurred:

Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.6/code.py",line 91,in runcode
    exec(code,self.locals)
  File "<console>",line 1,in <module>
  File "/app/.heroku/python/lib/python3.6/site-packages/celery/app/control.py",line 253,in ping
    timeout=timeout,**kwargs)
  File "/app/.heroku/python/lib/python3.6/site-packages/celery/app/control.py",line 454,in broadcast
    limit,callback,channel=channel,File "/app/.heroku/python/lib/python3.6/site-packages/kombu/pidBox.py",line 346,in _broadcast
    matcher=matcher)
  File "/app/.heroku/python/lib/python3.6/site-packages/kombu/pidBox.py",line 307,in _publish
    with self.producer_or_acquire(producer,chan) as producer:
  File "/app/.heroku/python/lib/python3.6/contextlib.py",line 81,in __enter__
    return next(self.gen)
  File "/app/.heroku/python/lib/python3.6/site-packages/kombu/pidBox.py",line 267,in producer_or_acquire
    with self.producer_pool.acquire() as producer:
  File "/app/.heroku/python/lib/python3.6/site-packages/kombu/resource.py",line 83,in acquire
    R = self.prepare(R)
  File "/app/.heroku/python/lib/python3.6/site-packages/kombu/pools.py",line 62,in prepare
    p = p()
  File "/app/.heroku/python/lib/python3.6/site-packages/kombu/utils/functional.py",line 210,in __call__
    return self.evaluate()
  File "/app/.heroku/python/lib/python3.6/site-packages/kombu/utils/functional.py",line 213,in evaluate
    return self._fun(*self._args,**self._kwargs)
  File "/app/.heroku/python/lib/python3.6/site-packages/kombu/pools.py",line 42,in create_producer
    conn = self._acquire_connection()
  File "/app/.heroku/python/lib/python3.6/site-packages/kombu/pools.py",line 39,in _acquire_connection
    return self.connections.acquire(block=True)
  File "/app/.heroku/python/lib/python3.6/site-packages/kombu/resource.py",line 78,in acquire
    R = self._resource.get(block=block,timeout=timeout)
  File "/app/.heroku/python/lib/python3.6/queue.py",line 164,in get
    self.not_empty.wait()
  File "/app/.heroku/python/lib/python3.6/threading.py",line 295,in wait
    waiter.acquire()
KeyboardInterrupt

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...