summaryrefslogtreecommitdiffstats
path: root/nova/rpc
diff options
context:
space:
mode:
authorChris Behrens <cbehrens@codestud.com>2012-03-08 01:36:44 -0800
committerChris Behrens <cbehrens@codestud.com>2012-03-08 01:36:44 -0800
commit0dfcdaa16eef1910b1a271bba32d4e365cff7e51 (patch)
tree3cff97ff607a759abd5f02409f536be49cca7d65 /nova/rpc
parent0193d1253c48c719b7f10bb19505ebb4b52defd3 (diff)
Exceptions unpacking rpc messages shouldn't hang the daemon
Fixes bug 949731 Change-Id: I83218012c37f7e5f16b2de8d26a738ac71eb89b4
Diffstat (limited to 'nova/rpc')
-rw-r--r--nova/rpc/impl_kombu.py7
-rw-r--r--nova/rpc/impl_qpid.py5
2 files changed, 9 insertions, 3 deletions
diff --git a/nova/rpc/impl_kombu.py b/nova/rpc/impl_kombu.py
index 8f527467f..f78005e3c 100644
--- a/nova/rpc/impl_kombu.py
+++ b/nova/rpc/impl_kombu.py
@@ -104,8 +104,11 @@ class ConsumerBase(object):
def _callback(raw_message):
message = self.channel.message_to_python(raw_message)
- callback(message.payload)
- message.ack()
+ try:
+ callback(message.payload)
+ message.ack()
+ except Exception:
+ LOG.exception(_("Failed to process message... skipping it."))
self.queue.consume(*args, callback=_callback, **options)
diff --git a/nova/rpc/impl_qpid.py b/nova/rpc/impl_qpid.py
index 88e820e82..8b10b7547 100644
--- a/nova/rpc/impl_qpid.py
+++ b/nova/rpc/impl_qpid.py
@@ -406,7 +406,10 @@ class Connection(object):
def _consume():
nxt_receiver = self.session.next_receiver(timeout=timeout)
- self._lookup_consumer(nxt_receiver).consume()
+ try:
+ self._lookup_consumer(nxt_receiver).consume()
+ except Exception:
+ LOG.exception(_("Error processing message. Skipping it."))
for iteration in itertools.count(0):
if limit and iteration >= limit: