kahlstrm commented on code in PR #39177:
URL: https://github.com/apache/airflow/pull/39177#discussion_r1575450388
##########
airflow/utils/log/file_task_handler.py:
##########
@@ -384,7 +380,13 @@ def _read(
worker_log_full_path = Path(self.local_base, worker_log_rel_path)
local_messages, local_logs =
self._read_from_local(worker_log_full_path)
messages_list.extend(local_messages)
- if is_running and not executor_messages:
+ if (
+ ti.state in (TaskInstanceState.RUNNING, TaskInstanceState.DEFERRED)
+ and not executor_messages
+ and not remote_logs
Review Comment:
To quote the author of #32561 who changed the behavior originally:
> If the task is running but is retried, the previous attempt logs opening
tries to go to served logs. But the logs from there can be already moved to
remote storage.
> We should skip served logs for non-running task try.
From what I understand happened with their case is that when a task instance
completes as a failure and it is then cleared (i.e. rerun) at a later time.
In this case the previous task try logs have possibly been moved to remote
logs already, and the task instance state goes back to
`TaskInstanceState.RUNNING`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]