gpt4 book ai didi

python - pidbox 收到方法 enable_events() [reply_to :None ticket:None] in Django-Celery

转载 作者:太空狗 更新时间:2023-10-29 20:31:08 26 4
gpt4 key购买 nike

我在我的服务器上安装了 Django-Celery 并尝试通过以下代码发送任务:

$ ./manage.py shell
Python 3.4.3 (default, Oct 14 2015, 20:28:29)
Type "copyright", "credits" or "license" for more information.

IPython 4.0.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.

In [1]: from OJ.models import *

In [2]: from OJ.tasks import *

In [3]: r=judge_delay.delay(Submit.objects.filter(id=9912)[0])

但是我得到的结果是

$ ./manage.py celeryd -l debug
[2017-04-26 19:46:46,961: DEBUG/MainProcess] | Worker: Preparing bootsteps.
[2017-04-26 19:46:46,963: DEBUG/MainProcess] | Worker: Building graph...
[2017-04-26 19:46:46,963: DEBUG/MainProcess] | Worker: New boot order: {Timer, Hub, Queues (intra), Pool, Autoreloader, StateDB, Beat, Autoscaler, Consumer}
[2017-04-26 19:46:46,967: DEBUG/MainProcess] | Consumer: Preparing bootsteps.
[2017-04-26 19:46:46,968: DEBUG/MainProcess] | Consumer: Building graph...
[2017-04-26 19:46:46,970: DEBUG/MainProcess] | Consumer: New boot order: {Connection, Events, Mingle, Tasks, Control, Gossip, Heart, Agent, event loop}

-------------- celery@OJ v3.1.25 (Cipater)
---- **** -----
--- * *** * -- Linux-3.19.0-33-generic-x86_64-with-Ubuntu-14.04-trusty
-- * - **** ---
- ** ---------- [config]
- ** ---------- .> app: default:0x7f87e70e6a90 (djcelery.loaders.DjangoLoader)
- ** ---------- .> transport: amqp://guest:**@localhost:5672//
- ** ---------- .> results: amqp://
- *** --- * --- .> concurrency: 4 (prefork)
-- ******* ----
--- ***** ----- [queues]
-------------- .> celery exchange=celery(direct) key=celery


[tasks]
. OJ.tasks.judge_delay
. celery.backend_cleanup
. celery.chain
. celery.chord
. celery.chord_unlock
. celery.chunks
. celery.group
. celery.map
. celery.starmap

[2017-04-26 19:46:46,975: DEBUG/MainProcess] | Worker: Starting Hub
[2017-04-26 19:46:46,975: DEBUG/MainProcess] ^-- substep ok
[2017-04-26 19:46:46,975: DEBUG/MainProcess] | Worker: Starting Pool
[2017-04-26 19:46:47,077: DEBUG/MainProcess] ^-- substep ok
[2017-04-26 19:46:47,078: DEBUG/MainProcess] | Worker: Starting Consumer
[2017-04-26 19:46:47,078: DEBUG/MainProcess] | Consumer: Starting Connection
[2017-04-26 19:46:47,090: INFO/MainProcess] Connected to amqp://guest:**@127.0.0.1:5672//
[2017-04-26 19:46:47,091: DEBUG/MainProcess] ^-- substep ok
[2017-04-26 19:46:47,091: DEBUG/MainProcess] | Consumer: Starting Events
[2017-04-26 19:46:47,101: DEBUG/MainProcess] ^-- substep ok
[2017-04-26 19:46:47,101: DEBUG/MainProcess] | Consumer: Starting Mingle
[2017-04-26 19:46:47,101: INFO/MainProcess] mingle: searching for neighbors
[2017-04-26 19:46:48,114: INFO/MainProcess] mingle: all alone
[2017-04-26 19:46:48,114: DEBUG/MainProcess] ^-- substep ok
[2017-04-26 19:46:48,115: DEBUG/MainProcess] | Consumer: Starting Tasks
[2017-04-26 19:46:48,124: DEBUG/MainProcess] ^-- substep ok
[2017-04-26 19:46:48,124: DEBUG/MainProcess] | Consumer: Starting Control
[2017-04-26 19:46:48,131: DEBUG/MainProcess] ^-- substep ok
[2017-04-26 19:46:48,131: DEBUG/MainProcess] | Consumer: Starting Gossip
[2017-04-26 19:46:48,138: DEBUG/MainProcess] ^-- substep ok
[2017-04-26 19:46:48,138: DEBUG/MainProcess] | Consumer: Starting Heart
[2017-04-26 19:46:48,140: DEBUG/MainProcess] ^-- substep ok
[2017-04-26 19:46:48,140: DEBUG/MainProcess] | Consumer: Starting event loop
[2017-04-26 19:46:48,143: WARNING/MainProcess] celery@OJ ready.
[2017-04-26 19:46:48,143: DEBUG/MainProcess] | Worker: Hub.register Pool...
[2017-04-26 19:46:48,144: DEBUG/MainProcess] basic.qos: prefetch_count->16
[2017-04-26 19:46:48,194: DEBUG/MainProcess] pidbox received method enable_events() [reply_to:None ticket:None]
[2017-04-26 19:46:48,194: INFO/MainProcess] Events of group {task} enabled by remote.
[2017-04-26 19:46:53,196: DEBUG/MainProcess] pidbox received method enable_events() [reply_to:None ticket:None]
[2017-04-26 19:46:58,194: DEBUG/MainProcess] pidbox received method enable_events() [reply_to:None ticket:None]
[2017-04-26 19:47:03,196: DEBUG/MainProcess] pidbox received method enable_events() [reply_to:None ticket:None]
[2017-04-26 19:47:08,194: DEBUG/MainProcess] pidbox received method enable_events() [reply_to:None ticket:None]
[2017-04-26 19:47:11,471: INFO/MainProcess] Received task: OJ.tasks.judge_delay[12a1a1cb-6822-463c-b4a7-7aefc20b951c]
[2017-04-26 19:47:11,492: DEBUG/MainProcess] TaskPool: Apply <function _fast_trace_task at 0x7f87e6e28378> (args:('OJ.tasks.judge_delay', '12a1a1cb-6822-463c-b4a7-7aefc20b951c', (<Submit: 9912 A+B Problem testbot80 1 -1>,), {}, {'callbacks': None, 'delivery_info': {'routing_key': 'celery', 'redelivered': False, 'priority': 0, 'exchange': 'celery'}, 'retries': 0, 'id': '12a1a1cb-6822-463c-b4a7-7aefc20b951c', 'args': (<Submit: 9912 A+B Problem testbot80 1 -1>,), 'headers': {}, 'chord': None, 'reply_to': '02ac5b4b-c4b2-3020-aef0-7e930a64f174', 'is_eager': False, 'timelimit': (None, None), 'expires': None, 'hostname': 'celery@OJ', 'kwargs': {}, 'taskset': None, 'group': None, 'eta': None, 'errbacks': None, 'correlation_id': '12a1a1cb-6822-463c-b4a7-7aefc20b951c', 'task': 'OJ.tasks.judge_delay', 'utc': True}) kwargs:{})
[2017-04-26 19:47:11,499: DEBUG/MainProcess] Task accepted: OJ.tasks.judge_delay[12a1a1cb-6822-463c-b4a7-7aefc20b951c] pid:5559
[2017-04-26 19:47:13,197: DEBUG/MainProcess] pidbox received method enable_events() [reply_to:None ticket:None]
[2017-04-26 19:47:18,198: DEBUG/MainProcess] pidbox received method enable_events() [reply_to:None ticket:None]
[2017-04-26 19:47:23,195: DEBUG/MainProcess] pidbox received method enable_events() [reply_to:None ticket:None]
[2017-04-26 19:47:28,197: DEBUG/MainProcess] pidbox received method enable_events() [reply_to:None ticket:None]
^C
worker: Hitting Ctrl+C again will terminate all running tasks!

worker: Warm shutdown (MainProcess)
[2017-04-26 19:47:30,308: DEBUG/MainProcess] | Worker: Closing Hub...
[2017-04-26 19:47:30,308: DEBUG/MainProcess] | Worker: Closing Pool...
[2017-04-26 19:47:30,309: DEBUG/MainProcess] | Worker: Closing Consumer...
[2017-04-26 19:47:30,309: DEBUG/MainProcess] | Worker: Stopping Consumer...
[2017-04-26 19:47:30,309: DEBUG/MainProcess] | Consumer: Closing Connection...
[2017-04-26 19:47:30,310: DEBUG/MainProcess] | Consumer: Closing Events...
[2017-04-26 19:47:30,310: DEBUG/MainProcess] | Consumer: Closing Mingle...
[2017-04-26 19:47:30,310: DEBUG/MainProcess] | Consumer: Closing Tasks...
[2017-04-26 19:47:30,310: DEBUG/MainProcess] | Consumer: Closing Control...
[2017-04-26 19:47:30,310: DEBUG/MainProcess] | Consumer: Closing Gossip...
[2017-04-26 19:47:30,311: DEBUG/MainProcess] | Consumer: Closing Heart...
[2017-04-26 19:47:30,311: DEBUG/MainProcess] | Consumer: Closing event loop...
[2017-04-26 19:47:30,311: DEBUG/MainProcess] | Consumer: Stopping event loop...
[2017-04-26 19:47:30,311: DEBUG/MainProcess] | Consumer: Stopping Heart...
[2017-04-26 19:47:30,312: DEBUG/MainProcess] | Consumer: Stopping Gossip...
[2017-04-26 19:47:30,317: DEBUG/MainProcess] | Consumer: Stopping Control...
[2017-04-26 19:47:30,319: DEBUG/MainProcess] | Consumer: Stopping Tasks...
[2017-04-26 19:47:30,320: DEBUG/MainProcess] Canceling task consumer...
[2017-04-26 19:47:30,320: DEBUG/MainProcess] | Consumer: Stopping Mingle...
[2017-04-26 19:47:30,321: DEBUG/MainProcess] | Consumer: Stopping Events...
[2017-04-26 19:47:30,321: DEBUG/MainProcess] | Consumer: Stopping Connection...
[2017-04-26 19:47:30,321: DEBUG/MainProcess] | Worker: Stopping Pool...

我们可以看到任务收到了但是没有执行,conf文件和测试脚本如下:

# -*- coding: utf-8 -*-
from djcelery import celery
from OJ.models import *
import OJ.judpong as judger
@celery.task
def judge_delay(sub):
judger.judgePong(sub)
print("judeged.")

那么 pidbox received method enable_events() [reply_to:None ticket:None] 是什么意思呢?我的配置文件有问题吗??

最佳答案

我收到了同样的消息。我在 docker 环境中使用 celery ,在那里我启动了生产者、2 个 worker 和花。在我停止花的那一刻,日志行:pidbox received method enable_events() [reply_to:None ticket:None] 消失了。

关于python - pidbox 收到方法 enable_events() [reply_to :None ticket:None] in Django-Celery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43633914/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com