summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Goulish <mgoulish@apache.org>2012-03-14 14:33:28 +0000
committerMichael Goulish <mgoulish@apache.org>2012-03-14 14:33:28 +0000
commitbc690ca52a0df68e32aabaf469281ed4964cc66e (patch)
treeec587a06478cb63e7d413185aec6f2ca4d7527f7
parent2eba5d7f6bf02db9d0ea62e4c0d75ae959553f2a (diff)
downloadqpid-python-bc690ca52a0df68e32aabaf469281ed4964cc66e.tar.gz
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. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1300562 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/python/qpid/connection.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/qpid/python/qpid/connection.py b/qpid/python/qpid/connection.py
index f2c83d113c..66e1cb49be 100644
--- a/qpid/python/qpid/connection.py
+++ b/qpid/python/qpid/connection.py
@@ -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())