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()