uranusjr commented on code in PR #41560:
URL: https://github.com/apache/airflow/pull/41560#discussion_r1728200192


##########
airflow/jobs/scheduler_job_runner.py:
##########
@@ -348,6 +348,7 @@ def _executable_task_instances_to_queued(self, max_tis: 
int, session: Session) -
 
         # dag_id to # of running tasks and (dag_id, task_id) to # of running 
tasks.
         concurrency_map = self.__get_concurrency_maps(states=EXECUTION_STATES, 
session=session)
+        concurrency_map_deferred = 
self.__get_concurrency_maps(states=DEFERRED_STATES, session=session)

Review Comment:
   This should be something like
   
   ```python
   if max_active_tasks_include_deferred:
       concurrency_map = self.__get_concurrency_maps(states=DEFERRED_STATES | 
EXECUTION_STATE, session=session)
   else:
       concurrency_map = self.__get_concurrency_maps(states=EXECUTION_STATES, 
session=session)
   ```
   
   to save one db query.



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