summaryrefslogtreecommitdiffstats
path: root/openstack/common/rpc/impl_kombu.py
diff options
context:
space:
mode:
authorKei Masumoto <masumotok@nttdata.co.jp>2013-01-22 23:51:11 +0900
committerKei Masumoto <masumotok@nttdata.co.jp>2013-02-13 22:59:15 +0900
commita7f23d95a2cfa727069d524132c1e9ee4fd2f149 (patch)
tree1cd4538c7cecbfe7e04c6a306195459bab32cc04 /openstack/common/rpc/impl_kombu.py
parenteaab5fae2502198e9fa57d0d90a7204a2bd83b16 (diff)
downloadoslo-a7f23d95a2cfa727069d524132c1e9ee4fd2f149.tar.gz
oslo-a7f23d95a2cfa727069d524132c1e9ee4fd2f149.tar.xz
oslo-a7f23d95a2cfa727069d524132c1e9ee4fd2f149.zip
Fix Lack of reconnecting operation when using rabbitmq mirrored queue
On using Mirrored Queue feature in impl_kombu.py, there is a case that messages are lost because amqp client does not handle exceptions properly when rabbitmq is dead on the way to wait return value of call(). This patch fix this and enables ampq client reconnecting slave rabbitmq. Fixes bug 1102051 Change-Id: Ia7a1b9067f7ea4639195a1548de29e0364368e51
Diffstat (limited to 'openstack/common/rpc/impl_kombu.py')
-rw-r--r--openstack/common/rpc/impl_kombu.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/openstack/common/rpc/impl_kombu.py b/openstack/common/rpc/impl_kombu.py
index 4f3cc7a..d5fadea 100644
--- a/openstack/common/rpc/impl_kombu.py
+++ b/openstack/common/rpc/impl_kombu.py
@@ -165,9 +165,10 @@ class ConsumerBase(object):
try:
msg = rpc_common.deserialize_msg(message.payload)
callback(msg)
- message.ack()
except Exception:
LOG.exception(_("Failed to process message... skipping it."))
+ finally:
+ message.ack()
self.queue.consume(*args, callback=_callback, **options)