Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[eventlet] handle QUIT in a new coroutine #1217

Merged
merged 1 commit into from Mar 22, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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