Exceptions unpacking rpc messages shouldn't hang the daemon
Fixes bug 949731 Change-Id: I83218012c37f7e5f16b2de8d26a738ac71eb89b4
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user