mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
close tmp in the right place.
This commit is contained in:
parent
ea59668787
commit
56e1d90ab6
@ -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
|
||||||
@ -384,7 +388,7 @@ class Arbiter(object):
|
|||||||
"""
|
"""
|
||||||
for pid in self.WORKERS.keys():
|
for pid in self.WORKERS.keys():
|
||||||
self.kill_worker(pid, sig)
|
self.kill_worker(pid, sig)
|
||||||
|
|
||||||
def kill_worker(self, pid, sig):
|
def kill_worker(self, pid, sig):
|
||||||
""" kill a worker
|
""" kill a worker
|
||||||
|
|
||||||
@ -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)
|
||||||
raise
|
try:
|
||||||
finally:
|
worker.tmp.close()
|
||||||
try:
|
except:
|
||||||
worker.tmp.close()
|
pass
|
||||||
except:
|
raise
|
||||||
pass
|
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user