Silently pass when trying to kill child that is already dead.

This fixes #16.
This commit is contained in:
Vincent Driessen 2011-11-28 15:14:07 +01:00
parent 039a132374
commit 5c6f002878
1 changed files with 7 additions and 1 deletions

View File

@ -195,7 +195,13 @@ class Worker(object):
# Take down the horse with the worker # Take down the horse with the worker
if self.horse_pid: if self.horse_pid:
self.log.debug('Taking down horse %d with me.' % self.horse_pid) self.log.debug('Taking down horse %d with me.' % self.horse_pid)
try:
os.kill(self.horse_pid, signal.SIGKILL) os.kill(self.horse_pid, signal.SIGKILL)
except OSError as e:
# ESRCH ("No such process") is fine with us
if e.errno != errno.ESRCH:
self.log.debug('Horse already down.')
raise
raise SystemExit() raise SystemExit()
def request_stop(signum, frame): def request_stop(signum, frame):