From bd4b96e23c17fcea01c5aa402b9b7666f227f784 Mon Sep 17 00:00:00 2001 From: Niko Oliveira Date: Tue, 7 Nov 2023 11:05:59 -0800 Subject: [PATCH] Update ECS executor healthcheck with a catchall except Previously only ClientError was being caught. However, there are cases where Botocore (or perhaps other) exceptions can be thrown. Add a catchall except Exception to catch these cases. --- airflow/providers/amazon/aws/executors/ecs/ecs_executor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/airflow/providers/amazon/aws/executors/ecs/ecs_executor.py b/airflow/providers/amazon/aws/executors/ecs/ecs_executor.py index 5d5bef6b87afc..afad23f387a5b 100644 --- a/airflow/providers/amazon/aws/executors/ecs/ecs_executor.py +++ b/airflow/providers/amazon/aws/executors/ecs/ecs_executor.py @@ -145,6 +145,9 @@ def start(self): else: # Catch all for unexpected failures status = f"failed because: {error_message}. " + except Exception as e: + # Any non-ClientError exceptions. This can include Botocore exceptions for example + status = f"failed because: {e}. " finally: msg_prefix = "ECS Executor health check has %s" if status == success_status: