mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
After closing for error do not keep alive
Raise a StopIteration rather than returning so that the keep-alive loop is terminated. If gunicorn has closed the socket there is no sense in trying to read another request and it may cause spurious EBADF errors to try.
This commit is contained in:
parent
90fb09f618
commit
fa9d028d09
@ -113,7 +113,7 @@ class AsyncWorker(base.Worker):
|
||||
sock.close()
|
||||
except socket.error:
|
||||
pass
|
||||
return
|
||||
raise StopIteration()
|
||||
raise
|
||||
finally:
|
||||
try:
|
||||
|
||||
@ -152,8 +152,7 @@ class SyncWorker(base.Worker):
|
||||
client.close()
|
||||
except socket.error:
|
||||
pass
|
||||
|
||||
return
|
||||
raise StopIteration()
|
||||
# Only send back traceback in HTTP in debug mode.
|
||||
self.handle_error(req, client, addr, e)
|
||||
return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user