Skip to content

Commit

Permalink
Merge pull request #47 from wooparadog/fix-timeout
Browse files Browse the repository at this point in the history
Should catch socket.timeout exception
  • Loading branch information
wooparadog committed Oct 23, 2017
2 parents 89e5fce + e2a5d35 commit 7584472
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gunicorn_thrift/sync_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def handle(self, listener, client, addr):
self.notify()
except TTransport.TTransportException:
pass
except socket.timeout:
self.log.warning('Client timeout: %r', addr)
except socket.error as e:
if e.args[0] == errno.ECONNRESET:
self.log.debug(e)
Expand Down
2 changes: 2 additions & 0 deletions gunicorn_thrift/thriftpy_sync_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def handle(self, listener, client, addr):
self.notify()
except TTransportException:
pass
except socket.timeout:
self.log.warning('Client timeout: %r', addr)
except socket.error as e:
if e.args[0] == errno.ECONNRESET:
self.log.debug(e)
Expand Down

0 comments on commit 7584472

Please sign in to comment.