Closed Kalebe16 closed 3 months ago
This is not really an issue. I guess exit is not expected but then ctrl-c is also kind of a brutal way to exit the process. closing as none issue.
From my point of view, terminating the program with an exception is inelegant, anyway, my solution was this:
from gunicorn.app.base import BaseApplication
from gunicorn.workers.ggevent import GeventWorker
def monkey_patch_gevent_worker() -> None:
def handle_quit(self, sig, frame):
self.alive = False # This is enough to stop the gevent worker
GeventWorker.handle_quit = handle_quit
monkey_patch_gevent_worker()
python-version:
3.12.1
gunicorn-version:
22.0.0
gevent-version:
24.2.1