博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
celery 使用multiprocessing 问题记录
阅读量:6880 次
发布时间:2019-06-26

本文共 1253 字,大约阅读时间需要 4 分钟。

报错:

[2013-11-29 14:27:48,297: ERROR/MainProcess] Task app.add[e5d184c0-471f-4fc4-804c-f760178d4847] raised exception: AssertionError('daemonic processes are not allowed to have children',)Traceback (most recent call last):  File "/Users/aromanovich/Envs/celery3.1/lib/python2.7/site-packages/celery/app/trace.py", line 218, in trace_task    R = retval = fun(*args, **kwargs)  File "/Users/aromanovich/Envs/celery3.1/lib/python2.7/site-packages/celery/app/trace.py", line 398, in __protected_call__    return self.run(*args, **kwargs)  File "/Users/aromanovich/Projects/celery/app.py", line 10, in add    manager = multiprocessing.Manager()  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/__init__.py", line 99, in Manager    m.start()  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/managers.py", line 524, in start    self._process.start()  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 124, in start    'daemonic processes are not allowed to have children'

  解决方法:

  设置环境变量 export PYTHONOPTIMIZE=1

转载于:https://www.cnblogs.com/LD-linux/p/4913615.html

你可能感兴趣的文章