Skip to content
Permalink
Browse files
Fix conn close error on retrieving log events (#23470)
related: [#23469] (#23469).
  • Loading branch information
thinhnd2104 committed May 8, 2022
1 parent 766726f commit c3386c5fcf193bc3a13621af5f10162962f4308f
Showing 1 changed file with 4 additions and 1 deletion.
@@ -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
@@ -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)

0 comments on commit c3386c5

Please sign in to comment.