From 5b67bc53f3bcf94adedbf2d2df4ffa41ebafe9fc Mon Sep 17 00:00:00 2001 From: Hengqing Hu Date: Tue, 5 Jun 2012 14:54:28 +0800 Subject: [PATCH] Finally ack consumed message To avoid bad messages fill up the queue. Change-Id: Id57ff33cfcacf698f89fa7f1020c0c887ebe14ed --- nova/rpc/impl_kombu.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nova/rpc/impl_kombu.py b/nova/rpc/impl_kombu.py index b9fb081b..2c14087b 100644 --- a/nova/rpc/impl_kombu.py +++ b/nova/rpc/impl_kombu.py @@ -137,9 +137,10 @@ class ConsumerBase(object): message = self.channel.message_to_python(raw_message) try: callback(message.payload) - message.ack() except Exception: LOG.exception(_("Failed to process message... skipping it.")) + finally: + message.ack() self.queue.consume(*args, callback=_callback, **options)