Fix problem with removing PID from list

Closes-bug: #1460651

Change-Id: I92d72668d2c2a7f4f4a709f6cfea8f36310cc586
This commit is contained in:
Sergey Reshetnyak 2015-06-01 12:52:35 +03:00
parent 69d00f117a
commit 5d6cb33b38

View File

@ -163,9 +163,10 @@ class Server(object):
try:
pid, status = os.wait()
if os.WIFEXITED(status) or os.WIFSIGNALED(status):
LOG.error(_LE('Removing dead child %s'), pid)
self.children.remove(pid)
self.run_child()
if pid in self.children:
LOG.error(_LE('Removing dead child %s'), pid)
self.children.remove(pid)
self.run_child()
except OSError as err:
if err.errno not in (errno.EINTR, errno.ECHILD):
raise