私はこれを見て、私は私のアプリPythonのマルチプロセッシング出口エラー
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/lib/python2.6/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/lib/python2.6/multiprocessing/util.py", line 269, in _exit_function
p.join()
File "/usr/lib/python2.6/multiprocessing/process.py", line 119, in join
res = self._popen.wait(timeout)
File "/usr/lib/python2.6/multiprocessing/forking.py", line 117, in wait
return self.poll(0)
File "/usr/lib/python2.6/multiprocessing/forking.py", line 106, in poll
pid, sts = os.waitpid(self.pid, flag)
OSError: [Errno 4] Interrupted system call
Error in sys.exitfunc:
Traceback (most recent call last):
File "/usr/lib/python2.6/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/lib/python2.6/multiprocessing/util.py", line 269, in _exit_function
p.join()
File "/usr/lib/python2.6/multiprocessing/process.py", line 119, in join
res = self._popen.wait(timeout)
File "/usr/lib/python2.6/multiprocessing/forking.py", line 117, in wait
return self.poll(0)
File "/usr/lib/python2.6/multiprocessing/forking.py", line 106, in poll
pid, sts = os.waitpid(self.pid, flag)
OSError: [Errno 4] Interrupted system call
を終了するにはCtrl-Cを押したときに、私は私自身のものの上にツイストを使用しています、
ています私は、信号はCtrl-Cを登録次のコード
def sigHandler(self, arg1, arg2):
if not self.backuped:
self.stopAll()
else:
out('central', 'backuped ALREADY, now FORCE exiting')
exit()
def stopAll(self):
self.parserM.shutdown()
for each in self.crawlM:
each.shutdown()
self.backup()
reactor.stop()
、彼らがシャットダウンするように他の人に合図するとき、それはうまく
てシャットダウンにそれらを教えしようとすると私のすべてのプロセスが何らかの形であるexit = multiprocessing.Event()
def shutdown(self):
self.exit.set()
、このエラーが何であるか
def run(self):
while not self.exit.is_set():
do something
out('crawler', 'crawler exited sucessfully')
任意のアイデア?私は、特定のスレッドのインスタンスが複数ある場合にのみ取得します。
本当に素晴らしいです。このような深みに何かを説明する良いリソースはオンラインですか? –