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


   I see that `occupied_slots` includes QUEUED as well (`EXECUTION_STATES` 
includes RUNNING & QUEUED). 
   
   QUEUED tasks shouldn't be occupying slots in the pool should they?
   
   ```
       @provide_session
       def occupied_slots(self, session: Session):
           """
           Get the number of slots used by running/queued tasks at the moment.
   ...
           return (
               session.query(func.sum(TaskInstance.pool_slots))
               .filter(TaskInstance.pool == self.pool)
               .filter(TaskInstance.state.in_(list(EXECUTION_STATES)))
               .scalar()
           ) or 0
   ```


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