[Python-modules-commits] [python-gear] 01/01: Do not raise RetryIOError on blocked write

Thomas Goirand zigo at moszumanska.debian.org
Tue Sep 8 09:46:00 UTC 2015


This is an automated email from the git hooks/post-receive script.

zigo pushed a commit to annotated tag 0.5.8
in repository python-gear.

commit 5491e93d95e1dcde6de541f3e8a3452c9a0523d1
Author: James E. Blair <jeblair at hp.com>
Date:   Thu Jun 18 16:55:01 2015 -0700

    Do not raise RetryIOError on blocked write
    
    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
---
 gear/__init__.py | 4 ++--
 1 file 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:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-gear.git



More information about the Python-modules-commits mailing list