[FIX] workers no suicide on broken pipe

bzr revid: al@openerp.com-20130209172932-5w8zt239tw0sirne
This commit is contained in:
Antony Lesuisse 2013-02-09 18:29:32 +01:00
parent ec6a6782c9
commit d0392a2db0
1 changed files with 7 additions and 1 deletions

View File

@ -319,7 +319,13 @@ class WorkerHTTP(Worker):
fcntl.fcntl(client, fcntl.F_SETFD, flags)
# do request using WorkerBaseWSGIServer monkey patched with socket
self.server.socket = client
self.server.process_request(client,addr)
# tolerate broken pipe when the http client closes the socket before
# receiving the full reply
try:
self.server.process_request(client,addr)
except IOError, e:
if e.errno != errno.EPIPE:
raise
self.request_count += 1
def process_work(self):