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) sys.exit(-1)
finally: finally:
self.log.info("Worker %s exiting." % worker_pid) self.log.info("Worker %s exiting." % worker_pid)
try:
worker.tmp.close()
except:
pass
def kill_workers(self, sig): def kill_workers(self, sig):
""" kill all workers with signal sig """ kill all workers with signal sig
@ -396,9 +400,8 @@ class Arbiter(object):
except OSError, e: except OSError, e:
if e.errno == errno.ESRCH: if e.errno == errno.ESRCH:
worker = self.WORKERS.pop(pid) worker = self.WORKERS.pop(pid)
try:
worker.tmp.close()
except:
pass
raise raise
finally:
try:
worker.tmp.close()
except:
pass

View File

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