From 8f7458333888746433d9c05fa4f03df048874595 Mon Sep 17 00:00:00 2001 From: Yue Chao Qin Date: Tue, 7 Apr 2026 15:35:22 -0700 Subject: [PATCH] fix: Multinode `ended_at` and `Complete` status --- cloud_pipelines_backend/launchers/kubernetes_launchers.py | 2 +- cloud_pipelines_backend/orchestrator_sql.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cloud_pipelines_backend/launchers/kubernetes_launchers.py b/cloud_pipelines_backend/launchers/kubernetes_launchers.py index 8415a91..91b7c95 100644 --- a/cloud_pipelines_backend/launchers/kubernetes_launchers.py +++ b/cloud_pipelines_backend/launchers/kubernetes_launchers.py @@ -1366,7 +1366,7 @@ def ended_at(self) -> datetime.datetime | None: ended_condition_times = [ condition.last_transition_time for condition in job_status.conditions or [] - if condition.type in ("Succeeded", "Failed") and condition.status == "True" + if condition.type in ("Complete", "Failed") and condition.status == "True" ] if not ended_condition_times: return None diff --git a/cloud_pipelines_backend/orchestrator_sql.py b/cloud_pipelines_backend/orchestrator_sql.py index 4ac30a9..d9374f3 100644 --- a/cloud_pipelines_backend/orchestrator_sql.py +++ b/cloud_pipelines_backend/orchestrator_sql.py @@ -173,6 +173,7 @@ def internal_process_running_executions_queue(self, session: orm.Session): running_container_execution.status = ( bts.ContainerExecutionStatus.SYSTEM_ERROR ) + running_container_execution.ended_at = _get_current_time() # Doing an intermediate commit here because it's most important to mark the problematic execution as SYSTEM_ERROR. session.commit()