From e44d1716fa9df1b5fe292e036f4dcdb9976562a1 Mon Sep 17 00:00:00 2001 From: sjmiller609 Date: Tue, 17 Sep 2019 14:14:07 -0400 Subject: [PATCH] Fix logs downloading for tasks (#63) (cherry picked from commit e97916234ba67ec3dc7bbfa25f1ae1d03cdf6af2) (cherry picked from commit 87f2abb83ceb1b7d75843ec03623fde910cc16d4) (cherry picked from commit 06f19c98d4d0af2c2fab9a66b0b1edcf37c5a001) (cherry picked from commit 1b52c3a3c6e18ceb3f03f75833126df6a840d48c) --- airflow/utils/log/es_task_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/airflow/utils/log/es_task_handler.py b/airflow/utils/log/es_task_handler.py index de85f7c2bb464..69bac7b49da19 100644 --- a/airflow/utils/log/es_task_handler.py +++ b/airflow/utils/log/es_task_handler.py @@ -144,10 +144,10 @@ def _read(self, ti, try_number, metadata=None): if 'last_log_timestamp' in metadata: last_log_ts = timezone.parse(metadata['last_log_timestamp']) if cur_ts.diff(last_log_ts).in_minutes() >= 5 or 'max_offset' in metadata \ - and offset >= metadata['max_offset']: + and int(offset) >= int(metadata['max_offset']): metadata['end_of_log'] = True - if offset != next_offset or 'last_log_timestamp' not in metadata: + if int(offset) != int(next_offset) or 'last_log_timestamp' not in metadata: metadata['last_log_timestamp'] = str(cur_ts) # If we hit the end of the log, remove the actual end_of_log message