xBis7 commented on code in PR #54103:
URL: https://github.com/apache/airflow/pull/54103#discussion_r2708414793


##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -194,6 +207,16 @@ def _is_parent_process() -> bool:
     return multiprocessing.current_process().name == "MainProcess"
 
 
+def _get_current_dr_task_concurrency(states: Iterable[TaskInstanceState]) -> 
Subquery:
+    """Get the dag_run IDs and how many tasks are in the provided states for 
each one."""

Review Comment:
   I think you are referring to this part on lines 488-490
   
   ```python
   # dag_id to # of running tasks and (dag_id, task_id) to # of running tasks.
   concurrency_map = ConcurrencyMap()
   concurrency_map.load(session=session)
   ```
   
   It immediately executes the query and gets the results while 
`_get_current_dr_task_concurrency` creates a subquery that gets included in the 
main query. The subquery will be executed in a later point which could be 
immediate but it could also be after a while. The results could be different 
even after 3 seconds.
   
   Is that what you mean? And what I should explain in a comment?



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