我看到这个的时候我按Ctrl-C退出我的应用程序
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用下面的代码
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')
任何知道这个错误是什么? 我只得到它,当我有一个特定线程的多个实例。