close tmp in the right place.

This commit is contained in:
Benoit Chesneau 2010-02-17 13:32:43 +01:00
parent ea59668787
commit 56e1d90ab6
2 changed files with 11 additions and 8 deletions

View File

@ -377,6 +377,10 @@ class Arbiter(object):
sys.exit(-1)
finally:
self.log.info("Worker %s exiting." % worker_pid)
try:
worker.tmp.close()
except:
pass
def kill_workers(self, sig):
""" kill all workers with signal sig
@ -384,7 +388,7 @@ class Arbiter(object):
"""
for pid in self.WORKERS.keys():
self.kill_worker(pid, sig)
def kill_worker(self, pid, sig):
""" kill a worker
@ -396,9 +400,8 @@ class Arbiter(object):
except OSError, e:
if e.errno == errno.ESRCH:
worker = self.WORKERS.pop(pid)
raise
finally:
try:
worker.tmp.close()
except:
pass
try:
worker.tmp.close()
except:
pass
raise

View File

@ -67,7 +67,7 @@ class UnixSocket(BaseSocket):
return "unix:%s" % self.address
def create_socket(addr):
"""\
"""
Create a new socket for the given address. If the
address is a tuple, a TCP socket is created. If it
is a string, a Unix socket is created. Otherwise