zoukankan      html  css  js  c++  java
  • celery 使用multiprocessing 问题记录

    报错:

    [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

  • 相关阅读:
    kafka消费者问题
    kubernetes
    Grafana+prometheus+AlertManager+钉钉机器人
    kafka汇总
    java实现顺序表、链表、栈 (x)->{持续更新}
    hadoop细节 -> 持续更新
    drf之组件(认证、权限、排序、过滤、分页等)和xadmin、coreapi
    drf之视图类与路由
    drf序列化与反序列化
    drf之接口规范
  • 原文地址:https://www.cnblogs.com/LD-linux/p/4913615.html
Copyright © 2011-2022 走看看