This is an automated email from the ASF dual-hosted git repository.
jedcunningham pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new a1a23528da Improve intelligibility of end_of_log determination (#34788)
a1a23528da is described below
commit a1a23528da0edbd9587c8ab922ba325cfde79976
Author: Daniel Standish <[email protected]>
AuthorDate: Thu Oct 5 15:17:39 2023 -0700
Improve intelligibility of end_of_log determination (#34788)
---
airflow/providers/elasticsearch/log/es_task_handler.py | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/airflow/providers/elasticsearch/log/es_task_handler.py
b/airflow/providers/elasticsearch/log/es_task_handler.py
index 070d81543f..546dc57937 100644
--- a/airflow/providers/elasticsearch/log/es_task_handler.py
+++ b/airflow/providers/elasticsearch/log/es_task_handler.py
@@ -280,9 +280,8 @@ class ElasticsearchTaskHandler(FileTaskHandler,
ExternalLoggingMixin, LoggingMix
# end_of_log_mark may contain characters like '\n' which is needed to
# have the log uploaded but will not be stored in elasticsearch.
metadata["end_of_log"] = False
- for logs in logs_by_host.values():
- if logs[-1].message == self.end_of_log_mark:
- metadata["end_of_log"] = True
+ if any(x[-1].message == self.end_of_log_mark for x in
logs_by_host.values()):
+ metadata["end_of_log"] = True
cur_ts = pendulum.now()
if "last_log_timestamp" in metadata: