summaryrefslogtreecommitdiff
path: root/python/qpid/messaging/driver.py
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2010-02-26 16:19:09 +0000
committerRafael H. Schloming <rhs@apache.org>2010-02-26 16:19:09 +0000
commiteecd6b99d4db4b83ba3edd2cbad4bfa08a4bfec8 (patch)
tree993cc7f25e83195e2a241d518b7d5dd31adaba46 /python/qpid/messaging/driver.py
parentaea63c81f26fdeb89f8f57a45a2307fbe40e9283 (diff)
downloadqpid-python-eecd6b99d4db4b83ba3edd2cbad4bfa08a4bfec8.tar.gz
fixed reconnect
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@916739 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'python/qpid/messaging/driver.py')
-rw-r--r--python/qpid/messaging/driver.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/qpid/messaging/driver.py b/python/qpid/messaging/driver.py
index 10ff97418e..dadc3ab03a 100644
--- a/python/qpid/messaging/driver.py
+++ b/python/qpid/messaging/driver.py
@@ -350,7 +350,7 @@ class Driver:
if e is None:
e = "connection aborted"
- if (recoverable and self.connection.reconnect and
+ if (self.connection.reconnect and
(self.connection.reconnect_limit is None or
self.connection.reconnect_limit <= 0 or
self._attempts <= self.connection.reconnect_limit)):
@@ -359,7 +359,7 @@ class Driver:
else:
delay = self.connection.reconnect_delay
self._timeout = time.time() + delay
- log.warn("recoverable error[attempt %s]: %s" % (self._attempts, err))
+ log.warn("recoverable error[attempt %s]: %s" % (self._attempts, e))
if delay > 0:
log.warn("sleeping %s seconds" % delay)
self._retrying = True
@@ -420,6 +420,8 @@ class Driver:
host, port = self._hosts[self._host]
if self._retrying:
log.warn("trying: %s:%s", host, port)
+ self.engine = Engine(self.connection)
+ self.engine.open()
rawlog.debug("OPEN[%s]: %s:%s", self.log_id, host, port)
self._socket = connect(host, port)
if self._retrying:
@@ -428,8 +430,6 @@ class Driver:
self._attempts = 0
self._host = 0
self._retrying = False
- self.engine = Engine(self.connection)
- self.engine.open()
except socket.error, e:
self._host = (self._host + 1) % len(self._hosts)
self.close_engine(e)