From 9989c42c6773a791bc330d92c71f3fdf0ace8f59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Santiago=20Due=C3=B1as?= Date: Thu, 28 Nov 2024 19:03:40 +0100 Subject: [PATCH] [scheduler:eventizer] Fix git recovery params when workers die MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the case a worker dies while running an eventizer job, when recovering and re-scheduling the job the parameters are set as if the job ended successfully. Signed-off-by: Santiago DueƱas --- src/grimoirelab/core/scheduler/tasks/chronicler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/grimoirelab/core/scheduler/tasks/chronicler.py b/src/grimoirelab/core/scheduler/tasks/chronicler.py index 8d8e41c..39b8160 100644 --- a/src/grimoirelab/core/scheduler/tasks/chronicler.py +++ b/src/grimoirelab/core/scheduler/tasks/chronicler.py @@ -293,8 +293,13 @@ def recovery_args( if progress.summary and progress.summary.last_offset: job_args['recovery_commit'] = progress.summary.last_offset job_args['latest_items'] = False - else: + elif progress.summary: job_args['latest_items'] = True + else: + # Something went wrong on the side of the worker. + # The only thing we can do is to start over, + # without retrieving the latest items. + job_args['latest_items'] = False return job_args