revert a change. fix worker kill

This commit is contained in:
Benoit Chesneau 2010-01-10 10:15:05 +01:00
parent 0b8d51d116
commit 004f441d59
2 changed files with 4 additions and 3 deletions

View File

@ -158,6 +158,7 @@ class Arbiter(object):
self.stop()
def handle_quit(self):
self.stop(False)
raise StopIteration
def handle_int(self):

View File

@ -53,7 +53,7 @@ class Worker(object):
self.address = socket.getsockname()
self.tmp = os.tmpfile()
self.app = app
self.alive = self.tmp.fileno()
self.alive = True
def init_signals(self):
map(lambda s: signal.signal(s, signal.SIG_DFL), self.SIGNALS)
@ -74,7 +74,7 @@ class Worker(object):
spinner = (spinner+1) % 2
os.fchmod(self.alive, spinner)
while True:
while self.alive:
try:
ret = select.select([self.socket], [], [], 2.0)
except select.error, e:
@ -87,7 +87,7 @@ class Worker(object):
# processing clients that more clients are waiting. When
# there's no more clients waiting we go back to the select()
# loop and wait for some lovin.
while True:
while self.alive:
try:
(conn, addr) = self.socket.accept()
except socket.error, e: