首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Celeryd Worker停止处理任务

Celeryd Worker停止处理任务
EN

Stack Overflow用户
提问于 2012-06-02 02:00:28
回答 1查看 924关注 0票数 1

我有一个celeryd和两个worker一起运行,看着他们,我看到他们分别接受4个任务,处理它们,然后停止处理任务。(请注意,这些任务是长时间运行的,处理时间长达2分钟)。

celeryctl提供以下信息:

代码语言:javascript
复制
django@server: ./manage.py celeryctl inspect active
<- active
DEBUG 2012-06-01 12:51:11,330 amqplib 661 Start from server, version: 8.0, properties: {u'information': u'Licensed under the MPL.  See http://www.rabbitmq.com/', u'product': u'RabbitMQ', u'copyright': u'Copyright (C) 2007-2012 VMware, Inc.', u'capabilities': {}, u'platform': u'Erlang/OTP', u'version': u'2.8.2'}, mechanisms: [u'PLAIN', u'AMQPLAIN'], locales: [u'en_US']
DEBUG 2012-06-01 12:51:11,331 amqplib 507 Open OK! known_hosts []
DEBUG 2012-06-01 12:51:11,331 amqplib 70 using channel_id: 1
DEBUG 2012-06-01 12:51:11,332 amqplib 484 Channel open
-> eso-dev: OK
    - empty -

django@server:  ./manage.py celeryctl inspect scheduled
<- scheduled
DEBUG 2012-06-01 12:52:07,107 amqplib 661 Start from server, version: 8.0, properties: {u'information': u'Licensed under the MPL.  See http://www.rabbitmq.com/', u'product': u'RabbitMQ', u'copyright': u'Copyright (C) 2007-2012 VMware, Inc.', u'capabilities': {}, u'platform': u'Erlang/OTP', u'version': u'2.8.2'}, mechanisms: [u'PLAIN', u'AMQPLAIN'], locales: [u'en_US']
DEBUG 2012-06-01 12:52:07,108 amqplib 507 Open OK! known_hosts []
DEBUG 2012-06-01 12:52:07,108 amqplib 70 using channel_id: 1
DEBUG 2012-06-01 12:52:07,109 amqplib 484 Channel open
-> eso-dev: OK
    - empty -

django@server: ./manage.py celeryctl inspect registered
<- registered
DEBUG 2012-06-01 12:52:20,567 amqplib 661 Start from server, version: 8.0, properties: {u'information': u'Licensed under the MPL.  See http://www.rabbitmq.com/', u'product': u'RabbitMQ', u'copyright': u'Copyright (C) 2007-2012 VMware, Inc.', u'capabilities': {}, u'platform': u'Erlang/OTP', u'version': u'2.8.2'}, mechanisms: [u'PLAIN', u'AMQPLAIN'], locales: [u'en_US']
DEBUG 2012-06-01 12:52:20,568 amqplib 507 Open OK! known_hosts []
DEBUG 2012-06-01 12:52:20,568 amqplib 70 using channel_id: 1
DEBUG 2012-06-01 12:52:20,569 amqplib 484 Channel open
-> eso-dev: OK
    * celery.backend_cleanup
    * celery.chord
    * celery.chord_unlock
    *
celery_haystack.tasks.CeleryHaystackSignalHandler
    *
celery_haystack.tasks.CeleryHaystackUpdateIndex
    * convert.tasks.create_pdf
    * convert.tasks.create_pngs

此外,每次发生这种情况时,打印到日志的最后一件事是:

代码语言:javascript
复制
[2012-06-01 12:17:53,777: INFO/MainProcess] Task convert.tasks.create_pdf[319984de-5bc4-47fc-891f-273d827d625f] retry: None
None
[2012-06-01 12:17:54,327: INFO/MainProcess] Task convert.tasks.create_pdf[8a89f3c1-e991-487e-a2db-a57d23bae17f] retry: None
None

就在打印之前,任务也恰好失败了,在我的代码中,我所调用的全部内容是:

代码语言:javascript
复制
except HTTPError, e:
    statsd.incr('A.stat')
    log.warn('Woops: %s', e)
    create_pdf.retry()

如果我终止celeryd (^C,它马上就死了,不再等待任务)并重新启动它,它会继续运行,就像没有发生任何事情一样,再多执行几个任务,然后再死一次(我认为它总是在create_pdf任务上,但日志显示这个任务失败了,正在重试,没有任何问题)

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-09-10 11:44:44

这是一个已知的错误,芹菜已在3.0版本中修复。(Issue 707)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10855162

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档