ferruzzi commented on code in PR #37839:
URL: https://github.com/apache/airflow/pull/37839#discussion_r1509575621


##########
airflow/providers/amazon/aws/executors/ecs/ecs_executor.py:
##########
@@ -302,14 +302,15 @@ def __handle_failed_task(self, task_arn: str, reason: 
str):
                 self.__class__.MAX_RUN_TASK_ATTEMPTS,
                 task_arn,
             )
-            self.active_workers.increment_failure_count(task_key)
+            if increment:
+                self.active_workers.increment_failure_count(task_key)
             self.pending_tasks.appendleft(
                 EcsQueuedTask(
                     task_key,
                     task_cmd,
                     queue,
                     exec_info,
-                    failure_count + 1,
+                    failure_count + 1 if increment else failure_count,

Review Comment:
   The local variable `failure_count` is set before the 
`active_workers.increment_failure_count()` call and not updated by it.  I 
considered adjusting `active_workers.increment_failure_count()` to return the 
new count and assigning the return to local `failure_count` but I'm not sure if 
anything is gained by that.  Thoughts?



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