You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/04/16 05:27:23 UTC

[GitHub] [airflow] wongelz commented on issue #15399: Not scheduling since there are (negative number) open slots in pool

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:
users@infra.apache.org