summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2014-04-09 11:32:44 -0400
committerRussell Bryant <rbryant@redhat.com>2014-04-09 11:37:41 -0400
commit4c738572b2773a822639de9a757e982204360774 (patch)
treea87b43dcf21cd19e9c4f3bd2757e8abd4ff8f202
parentb7ad6ddab8b1d61bf4f52ccaa461a9d68809747b (diff)
downloadoslo-incubator-2014.1.tar.gz
Update ensure()/reconnect() to catch MessagingError2014.1
The error handling code that gets connections reset if necessary caught ConnectionError. It really needs to catch MessagingError, which ConnectionError inherits from. There are other types of MessagingErrors that may occur, such as InternalError, and they need to cause the connection to reset, as well. This fix has already been merged into oslo.messaging. Closes-bug: #1303890 Change-Id: Ic5082b74a362ded8b35cbc75cf178fe6e0db62d0 (cherry picked from commit 234f64d608266f43d8856ff98c89ceba6699d752)
-rw-r--r--openstack/common/rpc/impl_qpid.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/openstack/common/rpc/impl_qpid.py b/openstack/common/rpc/impl_qpid.py
index cb0c6c0e..dc47661d 100644
--- a/openstack/common/rpc/impl_qpid.py
+++ b/openstack/common/rpc/impl_qpid.py
@@ -504,7 +504,7 @@ class Connection(object):
if self.connection.opened():
try:
self.connection.close()
- except qpid_exceptions.ConnectionError:
+ except qpid_exceptions.MessagingError:
pass
broker = self.brokers[next(self.next_broker_indices)]
@@ -512,7 +512,7 @@ class Connection(object):
try:
self.connection_create(broker)
self.connection.open()
- except qpid_exceptions.ConnectionError as e:
+ except qpid_exceptions.MessagingError as e:
msg_dict = dict(e=e, delay=delay)
msg = _LE("Unable to connect to AMQP server: %(e)s. "
"Sleeping %(delay)s seconds") % msg_dict
@@ -540,7 +540,7 @@ class Connection(object):
try:
return method(*args, **kwargs)
except (qpid_exceptions.Empty,
- qpid_exceptions.ConnectionError) as e:
+ qpid_exceptions.MessagingError) as e:
if error_callback:
error_callback(e)
self.reconnect()