有人尝试过使用 pdb 调试 celeryd 工作程序吗?每当遇到断点(通过 pdb 运行 celeryd,或者通过pdb.set_trace()
),我遇到了以下错误:
Error while handling action event.
Traceback (most recent call last):
File "/home/jeeyo/workspace3/uwcr/subscriptions/tasks.py", line 79, in process_action_event
func(action_event)
File "/home/jeeyo/workspace3/uwcr/subscriptions/tasks.py", line 36, in new_user_email
send_registration_email(username, new_user.get_profile().plaintext_password)
File "/home/jeeyo/workspace3/uwcr/looers/email.py", line 18, in send_registration_email
'Your password from UWCoopRankings', user
File "/home/jeeyo/workspace3/uwcr/looers/email.py", line 61, in send_email
if isinstance(to, basestring):
File "/home/jeeyo/workspace3/uwcr/looers/email.py", line 61, in send_email
if isinstance(to, basestring):
File "/usr/lib/python2.6/bdb.py", line 46, in trace_dispatch
return self.dispatch_line(frame)
File "/usr/lib/python2.6/bdb.py", line 65, in dispatch_line
if self.quitting: raise BdbQuit
BdbQuit
有什么办法解决这个问题吗?
我有同样的问题。尝试使用 Celery 的远程调试器rdb
反而:
from celery import task
from celery.contrib import rdb
@task()
def add(x, y):
result = x + y
rdb.set_trace() # <- set break-point
return result
See the 用户指南 http://docs.celeryproject.org/en/latest/userguide/debugging.html(链接更新 2017/5)。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)