Skip to content

Commit

Permalink
Fix conn close error on retrieving log events (#23470)
Browse files Browse the repository at this point in the history
related: [#23469] (#23469).
  • Loading branch information
thinhnd2104 committed May 8, 2022
1 parent 766726f commit c3386c5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion airflow/providers/amazon/aws/operators/ecs.py
Expand Up @@ -25,7 +25,7 @@
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
Expand Down Expand Up @@ -139,6 +139,9 @@ def _get_log_events(self, skip: int = 0) -> Generator:
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)
Expand Down

0 comments on commit c3386c5

Please sign in to comment.