qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mgoul...@apache.org
Subject svn commit: r1300562 - /qpid/trunk/qpid/python/qpid/connection.py
Date Wed, 14 Mar 2012 14:33:28 GMT
Author: mgoulish
Date: Wed Mar 14 14:33:28 2012
New Revision: 1300562

URL: http://svn.apache.org/viewvc?rev=1300562&view=rev
Log:
QPID-3898

When connecting through SSL, qpid-tool starts disconnecting and 
reconnecting every 10 seconds.  

The connection it makes is good -- it gets real data.  But then 
it unilaterally decides to disconnect, immediately reconnects -- 
and cycles this way forever.   Well -- until you stop it, anyway.  
qpid-stat does not do this.

This is similar to a problem that was fixed long ago in the original 
code -- but that was written  before SSL support was available in Python.


Modified:
    qpid/trunk/qpid/python/qpid/connection.py

Modified: qpid/trunk/qpid/python/qpid/connection.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/connection.py?rev=1300562&r1=1300561&r2=1300562&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/connection.py (original)
+++ qpid/trunk/qpid/python/qpid/connection.py Wed Mar 14 14:33:28 2012
@@ -170,6 +170,10 @@ class Connection(Framer):
           if not status:
             self.detach_all()
             break
+      # When we do not use SSL transport, we get periodic 
+      # spurious timeout events on the socket.  When using SSL,
+      # these events show up as timeout *errors*.  Both should be
+      # ignored unless we have aborted.
       except socket.timeout:
         if self.aborted():
           self.close_code = (None, "connection timed out")
@@ -178,9 +182,12 @@ class Connection(Framer):
         else:
           continue
       except socket.error, e:
-        self.close_code = (None, str(e))
-        self.detach_all()
-        break
+        if self.aborted() or str(e) != "The read operation timed out":
+          self.close_code = (None, str(e))
+          self.detach_all()
+          break
+        else:
+          continue
       frame_dec.write(data)
       seg_dec.write(*frame_dec.read())
       op_dec.write(*seg_dec.read())



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message