From 7bd29624a96a04c2ba51c1e98f5c643d523b08c2 Mon Sep 17 00:00:00 2001 From: SdgJlbl Date: Thu, 26 Oct 2023 10:39:51 +0200 Subject: [PATCH] WIP fix Failure report handling when errors during remote function download Signed-off-by: SdgJlbl --- backend/substrapp/tasks/tasks_compute_task.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/substrapp/tasks/tasks_compute_task.py b/backend/substrapp/tasks/tasks_compute_task.py index 6b7ea555f..24fa64eb0 100644 --- a/backend/substrapp/tasks/tasks_compute_task.py +++ b/backend/substrapp/tasks/tasks_compute_task.py @@ -48,7 +48,7 @@ from substrapp.compute_tasks.lock import MAX_TASK_DURATION from substrapp.compute_tasks.lock import acquire_compute_plan_lock from substrapp.compute_tasks.outputs import OutputSaver -from substrapp.exceptions import OrganizationHttpError +from substrapp.exceptions import OrganizationHttpError, OrganizationError from substrapp.lock_local import lock_resource from substrapp.orchestrator import get_orchestrator_client from substrapp.tasks.task import ComputeTask @@ -200,7 +200,13 @@ def _run( image_builder.wait_for_image_built(ctx.function, channel_name) if get_owner() != ctx.function.owner: - image_builder.load_remote_function_image(ctx.function, channel_name) + try: + image_builder.load_remote_function_image(ctx.function, channel_name) + except OrganizationHttpError as e: + raise compute_task_errors.CeleryNoRetryError() from e + except OrganizationError as e: + raise compute_task_errors.CeleryRetryError() from e + # stop build_image timer _create_task_profiling_step(channel_name, task.key, ComputeTaskSteps.BUILD_IMAGE, timer.stop())