repl-chris commented on code in PR #23690:
URL: https://github.com/apache/airflow/pull/23690#discussion_r875327440


##########
airflow/executors/celery_executor.py:
##########
@@ -469,6 +505,15 @@ def try_adopt_task_instances(self, tis: 
List[TaskInstance]) -> List[TaskInstance
 
         return not_adopted_tis
 
+    def _set_stalled_task_timeout(self, key: TaskInstanceKey, timeout: 
datetime.timedelta) -> None:
+        if timeout:
+            self.stalled_task_timeouts[key] = utcnow() + timeout
+            self.stalled_task_timeouts = dict(
+                sorted(self.stalled_task_timeouts.items(), key=lambda item: 
item[1])
+            )

Review Comment:
   After shifting the adopted tasks and stalled tasks to each be tracked in 
their own dicts, sorting is no longer necessary at all as both dicts inherently 
stay sorted naturally



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