ephraimbuddy commented on code in PR #61769:
URL: https://github.com/apache/airflow/pull/61769#discussion_r3159170696


##########
airflow-core/src/airflow/models/taskinstance.py:
##########
@@ -1923,16 +1924,21 @@ def xcom_pull(
         )
 
     @provide_session
-    def get_num_running_task_instances(self, session: Session, same_dagrun: 
bool = False) -> int:
-        """Return Number of running TIs from the DB."""
-        # .count() is inefficient
+    def get_num_active_task_instances(self, session: Session, same_dagrun: 
bool = False) -> int:
+        """
+        Count active TIs for this task from the DB.
+
+        Counts task instances in running, queued, or deferred state.
+        Deferred TIs are included because they are still logically in-flight

Review Comment:
   We can also document why we included `queued` state in this layer



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