From ebbaf6f05bcdee89f262037fd934967c5150f9c5 Mon Sep 17 00:00:00 2001 From: Viktor Seifert Date: Mon, 18 Jul 2022 14:02:35 +0200 Subject: [PATCH] RED-4653: Added re-raising of a caught exception druing message processing to prevent infinite re-tries --- pyinfra/queue/queue_manager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyinfra/queue/queue_manager.py b/pyinfra/queue/queue_manager.py index e5db562..c12be9f 100644 --- a/pyinfra/queue/queue_manager.py +++ b/pyinfra/queue/queue_manager.py @@ -82,7 +82,8 @@ class QueueManager(object): self._channel.basic_ack(frame.delivery_tag) except Exception as ex: n_attempts = _get_n_previous_attempts(properties) + 1 - logger.warning(f"Message failed to process, {n_attempts} attempts, error {str(ex)}: message: {body}") + logger.warning(f"Failed to process message, {n_attempts} attempts, error: {str(ex)}") + raise ex return callback