jedcunningham commented on code in PR #31101:
URL: https://github.com/apache/airflow/pull/31101#discussion_r1186511174
##########
airflow/utils/log/file_task_handler.py:
##########
@@ -317,18 +316,24 @@ def _read(
executor_messages, executor_logs = response
if executor_messages:
messages_list.extend(messages_list)
- if ti.state in (TaskInstanceState.RUNNING, TaskInstanceState.DEFERRED)
and not executor_messages:
- served_messages, served_logs = self._read_from_logs_server(ti,
worker_log_rel_path)
- messages_list.extend(served_messages)
if not (remote_logs and ti.state not in State.unfinished):
# when finished, if we have remote logs, no need to check local
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 ti.state in (TaskInstanceState.RUNNING, TaskInstanceState.DEFERRED)
and not executor_messages:
+ served_messages, served_logs = self._read_from_logs_server(ti,
worker_log_rel_path)
+ messages_list.extend(served_messages)
+ elif ti.state not in State.unfinished 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 found,
we'll check the worker
Review Comment:
```suggestion
# so even if task is done, if no local logs or remote logs are
found, we'll check the worker
```
nit
--
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]