From 549e679f61b761d665c9973cc0308ab804ad7c9c Mon Sep 17 00:00:00 2001 From: ido177 Date: Fri, 15 Aug 2025 16:00:22 +0400 Subject: [PATCH] Update airflow-core/src/airflow/utils/log/file_task_handler.py --- airflow-core/src/airflow/utils/log/file_task_handler.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/airflow-core/src/airflow/utils/log/file_task_handler.py b/airflow-core/src/airflow/utils/log/file_task_handler.py index 33c53199caa60..9c2d5a6092986 100644 --- a/airflow-core/src/airflow/utils/log/file_task_handler.py +++ b/airflow-core/src/airflow/utils/log/file_task_handler.py @@ -649,7 +649,9 @@ def _read( if ti.state in (TaskInstanceState.RUNNING, TaskInstanceState.DEFERRED) and not has_k8s_exec_pod: sources, served_logs = self._read_from_logs_server(ti, worker_log_rel_path) source_list.extend(sources) - elif ti.state not in State.unfinished and not (local_logs or remote_logs): + elif (ti.state not in State.unfinished or ti.state == TaskInstanceState.UP_FOR_RETRY) and not ( + local_logs or remote_logs + ): # ordinarily we don't check served logs, with the assumption that users set up # remote logging or shared drive for logs for persistence, but that's not always true # so even if task is done, if no local logs or remote logs are found, we'll check the worker