when stopping the arbiter, close the listener asap

setting self.LISTENER to None is not enough because
self.WORKERS also have references to it
This commit is contained in:
Denis Bilenko 2011-08-08 14:30:25 +07:00 committed by Randall Leeds
parent 388612f628
commit 32862a694a

View File

@ -316,6 +316,10 @@ class Arbiter(object):
:attr graceful: boolean, If True (the default) workers will be
killed gracefully (ie. trying to wait for the current connection)
"""
try:
self.LISTENER.close()
except Exception:
pass
self.LISTENER = None
sig = signal.SIGQUIT
if not graceful: