我已经在烧瓶应用程序中实现了带有芹菜的队列。一切都很好。但是我需要使用称为sublist3r的模块,当我在芹菜任务中使用它时,我会收到此错误:
[2019-02-16 21:32:52,658: INFO/ForkPoolWorker-6] Task tasks.task.addd[57793628-de25-4c89-a265-5fee69a8b2bf] succeeded in 0.0236732449848s: None
[2019-02-16 21:32:52,660: WARNING/ForkPoolWorker-6] Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/me/code/proj/tasks/task.py", line 15, in getd
sub = sublist3r.main(url, 40, None, ports=None, silent=True,verbose=False, enable_bruteforce=False, engines=None)
File "/home/me/code/proj/sublist3r/sublist3r.py", line 871, in main
subdomains_queue = multiprocessing.Manager().list()
File "/usr/lib/python2.7/multiprocessing/__init__.py", line 99, in Manager
m.start()
File "/usr/lib/python2.7/multiprocessing/managers.py", line 524, in start
self._process.start()
File "/usr/lib/python2.7/multiprocessing/process.py", line 124, in start
'daemonic processes are not allowed to have children'
**AssertionError: daemonic processes are not allowed to have children**
这是因为我试图使用使用线程的模块而发生的?如何在队列或异步中使用此模块实现?
谢谢
看来sublist3r
使用多处理并尝试启动自己的过程。您不能在芹菜中真正做到这一点,因为在生产中,芹菜已经在自己的子过程中启动了一个工人,而且从错误消息中可以看出,芹菜将不允许您启动Sublist3R的多处理过程用途。如果您想使用它,最好的选择是将这些类重写为sublist3r中的这些类,以从 celery.Task
而不是 multiprocessing.Process
派生。