Skip to content

Commit

Permalink
#3227: do not allow keepalive if the worker is about to be restarted
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Daniliszyn 1 committed Oct 15, 2024
1 parent 9802e21 commit fb62e1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gunicorn/workers/base_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def handle(self, listener, client, addr):
parser = http.RequestParser(self.cfg, client, addr)
try:
listener_name = listener.getsockname()
if not self.cfg.keepalive:
# do not allow keepalive if the worker is about to be restarted
if not self.cfg.keepalive or not self.alive:
req = next(parser)
self.handle_request(listener_name, req, client, addr)
else:
Expand Down

0 comments on commit fb62e1e

Please sign in to comment.