From a7f23d95a2cfa727069d524132c1e9ee4fd2f149 Mon Sep 17 00:00:00 2001 From: Kei Masumoto Date: Tue, 22 Jan 2013 23:51:11 +0900 Subject: 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 --- openstack/common/rpc/impl_kombu.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- cgit