summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2014-04-07 11:59:24 -0400
committerMatt Riedemann <mriedem@us.ibm.com>2014-04-11 08:20:38 -0700
commitf61a889786ad0be04bb3dcf5cffb3c659c2a8cef (patch)
treec795401cae09d3b09de408214f0bfae85e8a62c7
parent7d33217f2bf83b3ecf1a91fb8cdd31076265c068 (diff)
downloadoslo-messaging-f61a889786ad0be04bb3dcf5cffb3c659c2a8cef.tar.gz
Update ensure()/reconnect() to catch MessagingError
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. Closes-bug: #1303890 Change-Id: Ic5082b74a362ded8b35cbc75cf178fe6e0db62d0 (cherry picked from commit bb6f3f11f3d65e104faa8dc4ee1b880d0c6394a4)
-rw-r--r--oslo/messaging/_drivers/impl_qpid.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/oslo/messaging/_drivers/impl_qpid.py b/oslo/messaging/_drivers/impl_qpid.py
index f398840..54efc5d 100644
--- a/oslo/messaging/_drivers/impl_qpid.py
+++ b/oslo/messaging/_drivers/impl_qpid.py
@@ -509,7 +509,7 @@ class Connection(object):
if self.connection is not None and self.connection.opened():
try:
self.connection.close()
- except qpid_exceptions.ConnectionError:
+ except qpid_exceptions.MessagingError:
pass
broker = six.next(self.brokers)
@@ -517,7 +517,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 = _("Unable to connect to AMQP server: %(e)s. "
"Sleeping %(delay)s seconds") % msg_dict
@@ -545,7 +545,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()