dstandish commented on code in PR #40867:
URL: https://github.com/apache/airflow/pull/40867#discussion_r1683409487


##########
airflow/providers/amazon/aws/executors/ecs/ecs_executor.py:
##########
@@ -385,18 +385,25 @@ def attempt_task_runs(self):
                     )
                     self.pending_tasks.append(ecs_task)
                 else:
-                    self.send_message_to_task_logs(
-                        logging.ERROR,
-                        "ECS task %s has failed a maximum of %s times. Marking 
as failed. Reasons: %s",
-                        task_key,
-                        attempt_number,
-                        ", ".join(failure_reasons),
-                        ti=task_key,
+                    reasons_str = ", ".join(failure_reasons)
+                    self.log_task_event(
+                        record=Log(
+                            event="ecs executor queue error",
+                            task_instance=task_key,
+                            extra=(
+                                f"Task could not be queued after 
{attempt_number} attempts. "
+                                f"Marking as failed. Reasons: {reasons_str}"
+                            ),
+                        )
                     )
                     self.fail(task_key)
             elif not run_task_response["tasks"]:
-                self.send_message_to_task_logs(
-                    logging.ERROR, "ECS RunTask Response: %s", 
run_task_response, ti=task_key
+                self.log_task_event(
+                    record=Log(
+                        event="ecs runtime error",

Review Comment:
   does this mean the task ran and failed? or is it again some kind of submit 
failure?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to