wongelz commented on issue #15399:
URL: https://github.com/apache/airflow/issues/15399#issuecomment-822124897


   @jedcunningham Looks like the `slots_stats` method in `pool.py` may be 
under-reporting the number of running/queued slots here:
   
   ```
           state_count_by_pool = (
               session.query(TaskInstance.pool, TaskInstance.state, 
func.count())
               .filter(TaskInstance.state.in_(list(EXECUTION_STATES)))
               .group_by(TaskInstance.pool, TaskInstance.state)
           ).all()
   ```
   
   I think the query should be:
   
   ```
   session.query(TaskInstance.pool, TaskInstance.state, 
func.sum(TaskInstance.pool_slots))
   ```


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to