Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve intelligibility of end_of_log determination #34788

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions airflow/providers/elasticsearch/log/es_task_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,8 @@ def _read(
# 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:
Expand Down