Skip to content

Commit

Permalink
Merge pull request benoitc#1217 from benoitc/eventlet-async-quit
Browse files Browse the repository at this point in the history
[eventlet] handle QUIT in a new coroutine
  • Loading branch information
tilgovi committed Mar 22, 2016
2 parents 3cd1db1 + 3be8476 commit f38451e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions gunicorn/workers/geventlet.py
Expand Up @@ -94,6 +94,9 @@ def init_process(self):
self.patch()
super(EventletWorker, self).init_process()

def handle_quit(self, sig, frame):
eventlet.spawn(super(EventletWorker, self).handle_quit, sig, frame)

def timeout_ctx(self):
return eventlet.Timeout(self.cfg.keepalive or None, False)

Expand All @@ -118,11 +121,7 @@ def run(self):

while self.alive:
self.notify()
try:
eventlet.sleep(1.0)
except AssertionError:
self.alive = False
break
eventlet.sleep(1.0)

self.notify()
try:
Expand Down

0 comments on commit f38451e

Please sign in to comment.