summaryrefslogtreecommitdiff
path: root/gear/__init__.py
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@hp.com>2015-06-18 16:55:01 -0700
committerJames E. Blair <jeblair@hp.com>2015-06-18 16:55:01 -0700
commit5491e93d95e1dcde6de541f3e8a3452c9a0523d1 (patch)
tree3b4bdf49f53bd210ed9fd1540f5e777a3b284cc7 /gear/__init__.py
parentbb681360fcbcbb9a9b53f7e0fc02a752996a3cf3 (diff)
downloadgear-5491e93d95e1dcde6de541f3e8a3452c9a0523d1.tar.gz
Do not raise RetryIOError on blocked write0.5.8
When EAGAIN is returned on a socket write, do not raise RetryIOError. This exception is used principally to indicate that we have encountered a blocked read, and a method farther up the call stack may need to perform some cleanup. However, within the sendQueuedData method, all necessary cleanup is performed by the finally handler itself. Therefore, it is safe to ignore a blocked write, and count on either a subsequent write (which will append data to the queue and retry sending the oldest data) or the poll edge trigger to indicate that we should retry the write. There is nothing in the call stack above this method that has an exception handler for RetryIOError. Therefore, in the current state, the raised exception was causing connections to be disconnected due to the error. Change-Id: I9211fb6365f8f3b6dd0310430cf97926ce1f5d07
Diffstat (limited to 'gear/__init__.py')
-rw-r--r--gear/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gear/__init__.py b/gear/__init__.py
index 51c0c91..a4b8e23 100644
--- a/gear/__init__.py
+++ b/gear/__init__.py
@@ -2346,8 +2346,8 @@ class NonBlockingConnection(Connection):
if e.errno == errno.EAGAIN:
self.log.debug("Write operation on %s would block"
% self)
- raise RetryIOError()
- raise
+ else:
+ raise
finally:
data = data[r:]
if data: