Taragolis commented on code in PR #29447:
URL: https://github.com/apache/airflow/pull/29447#discussion_r1304062995


##########
airflow/providers/amazon/aws/operators/ecs.py:
##########
@@ -564,29 +561,17 @@ def _start_task(self, context):
         self.ecs_task_id = self.arn.split("/")[-1]
         self.log.info("ECS task ID is: %s", self.ecs_task_id)
 
-        if self.reattach:
-            # Save the task ARN in XCom to be able to reattach it if needed
-            self.xcom_push(context, key=self.REATTACH_XCOM_KEY, value=self.arn)
-
-    def _try_reattach_task(self, context):
-        task_def_resp = 
self.client.describe_task_definition(taskDefinition=self.task_definition)
-        ecs_task_family = task_def_resp["taskDefinition"]["family"]
-
+    def _try_reattach_task(self):
         list_tasks_resp = self.client.list_tasks(
-            cluster=self.cluster, desiredStatus="RUNNING", 
family=ecs_task_family
+            cluster=self.cluster, desiredStatus="RUNNING", 
startedBy=self.started_by

Review Comment:
   We can't get XCom from previous task run, because it removed by Airflow 
before spawn new task run.
   In additional I've just make `started_by` as private attribute



-- 
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