mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Ignore StopIteration in HTTP parser.
We're specifically throwing the stop iteration to signal that a connection was closed before data appeared (which is necessary for the Keep-Alive processing). While a bit confusing for sync workers as there's no Keep-Alive, it is an expected behavior. Closes #65
This commit is contained in:
parent
9631c2ab5a
commit
e12e77765a
@ -45,7 +45,7 @@ class AsyncWorker(base.Worker):
|
|||||||
if e[0] == errno.ECONNRESET:
|
if e[0] == errno.ECONNRESET:
|
||||||
self.log.warn("Ignoring connection reset")
|
self.log.warn("Ignoring connection reset")
|
||||||
else:
|
else:
|
||||||
self.log.warn("Ignoring EPIPE")
|
self.log.debug("Ignoring EPIPE")
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
self.log.exception("General error processing request.")
|
self.log.exception("General error processing request.")
|
||||||
try:
|
try:
|
||||||
|
|||||||
@ -73,11 +73,13 @@ class SyncWorker(base.Worker):
|
|||||||
parser = http.RequestParser(client)
|
parser = http.RequestParser(client)
|
||||||
req = parser.next()
|
req = parser.next()
|
||||||
self.handle_request(req, client, addr)
|
self.handle_request(req, client, addr)
|
||||||
|
except StopIteration:
|
||||||
|
self.log.debug("Ignored premature client disconnection.")
|
||||||
except socket.error, e:
|
except socket.error, e:
|
||||||
if e[0] != errno.EPIPE:
|
if e[0] != errno.EPIPE:
|
||||||
self.log.exception("Error processing request.")
|
self.log.exception("Error processing request.")
|
||||||
else:
|
else:
|
||||||
self.log.warn("Ignoring EPIPE")
|
self.log.debug("Ignoring EPIPE")
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
self.log.exception("Error processing request.")
|
self.log.exception("Error processing request.")
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user