This is an automated email from the ASF dual-hosted git repository.
potiuk 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 c3386c5fcf Fix conn close error on retrieving log events (#23470)
c3386c5fcf is described below
commit c3386c5fcf193bc3a13621af5f10162962f4308f
Author: thinhnd2104 <[email protected]>
AuthorDate: Mon May 9 05:32:09 2022 +0700
Fix conn close error on retrieving log events (#23470)
related: [#23469] (https://github.com/apache/airflow/issues/23469).
---
airflow/providers/amazon/aws/operators/ecs.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/airflow/providers/amazon/aws/operators/ecs.py
b/airflow/providers/amazon/aws/operators/ecs.py
index b1f710895d..66aaa19389 100644
--- a/airflow/providers/amazon/aws/operators/ecs.py
+++ b/airflow/providers/amazon/aws/operators/ecs.py
@@ -25,7 +25,7 @@ from logging import Logger
from threading import Event, Thread
from typing import Dict, Generator, Optional, Sequence
-from botocore.exceptions import ClientError
+from botocore.exceptions import ClientError, ConnectionClosedError
from botocore.waiter import Waiter
from airflow.exceptions import AirflowException
@@ -139,6 +139,9 @@ class EcsTaskLogFetcher(Thread):
self.logger.warning('Error on retrieving Cloudwatch log
events', error)
yield from ()
+ except ConnectionClosedError as error:
+ self.logger.warning('ConnectionClosedError on retrieving
Cloudwatch log events', error)
+ yield from ()
def _event_to_str(self, event: dict) -> str:
event_dt = datetime.utcfromtimestamp(event['timestamp'] / 1000.0)