uranusjr commented on code in PR #61769:
URL: https://github.com/apache/airflow/pull/61769#discussion_r3166361307
##########
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:
I removed queued from this function instead to keep the change minimal.
--
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]