From 34d9f38afec0d998195d302bb262fb95e44f9b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Tue, 29 Oct 2024 17:23:34 +0100 Subject: [PATCH] Make sure `bodhi_update` job runs don't get stuck in `queued` state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nikola Forró --- packit_service/worker/handlers/bodhi.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packit_service/worker/handlers/bodhi.py b/packit_service/worker/handlers/bodhi.py index 8719d7eca..edf64e007 100644 --- a/packit_service/worker/handlers/bodhi.py +++ b/packit_service/worker/handlers/bodhi.py @@ -192,6 +192,18 @@ def run(self) -> TaskResults: target_model.set_status("error") target_model.set_data({"error": error}) + except Exception as ex: + if self.celery_task and not self.celery_task.is_last_try(): + target_model.set_status("retry") + raise + + error = f"Internal error, please contact us: {ex}" + errors[target_model.target] = error + + target_model.set_status("error") + target_model.set_data({"error": error}) + raise + if errors: self.report_in_issue_repository(errors=errors)