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/12/09 19:49:55 UTC

[GitHub] [airflow] eladkal opened a new pull request #20178: Add specific warning when Task asks for more slots than pool defined with

eladkal opened a new pull request #20178:
URL: https://github.com/apache/airflow/pull/20178


   **Description:**
   In cases where task asks for more pool slots than the total number it has the scheduler generates the following warning:
   `[2021-12-09 19:37:51,949] {scheduler_job.py:407} INFO - Not executing <TaskInstance: a_pool.my_task scheduled__2021-12-09T19:08:00+00:0│172.18.0.10 [scheduled]> since it requires 4 slots but there are 2 open slots in the pool my_pool. ` 
   
   https://github.com/apache/airflow/blob/985bb06ba57ab67bb218ca9ca7549a81bea88f87/airflow/jobs/scheduler_job.py#L401-L408
   
   However this message is very confusing as the issue is not with open slots but with the total slots of the pool. Waiting for slots will not resolve the problem. To make the task run there must be an action from the user:
   
   1.  User to increase the total number of slots in the Pool
   2. User need to change the task code to requests less slots.
   
   This PR add specific log notice for this case.
   
   **Testing:**
   Added test to cover this case where pool is configured with 2 slots when task ask for 4 slots.
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/main/UPDATING.md).
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil commented on a change in pull request #20178: Add specific warning when Task asks for more slots than pool defined with

Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #20178:
URL: https://github.com/apache/airflow/pull/20178#discussion_r767831855



##########
File path: airflow/jobs/scheduler_job.py
##########
@@ -327,6 +327,17 @@ def _executable_task_instances_to_queued(self, max_tis: int, session: Session =
                 self.log.warning("Tasks using non-existent pool '%s' will not be scheduled", pool)
                 continue
 
+            pool_total = pools[pool]["total"]
+            if task_instance.pool_slots > pool_total:
+                self.log.warning(
+                    "Not executing %s since requesting %s slots when total pool '%s' slots are %s.",
+                    task_instance,
+                    task_instance.pool_slots,
+                    pool,
+                    pool_total,
+                )

Review comment:
       ```suggestion
                   self.log.warning(
                       "Not executing %s. Requested pool slots (%s) are greater than total pool slots: '%s' for pool: %s.",
                       task_instance,
                       task_instance.pool_slots,
                       pool_total,
                       pool,
                   )
   ```
   

##########
File path: airflow/jobs/scheduler_job.py
##########
@@ -327,6 +327,17 @@ def _executable_task_instances_to_queued(self, max_tis: int, session: Session =
                 self.log.warning("Tasks using non-existent pool '%s' will not be scheduled", pool)
                 continue
 
+            pool_total = pools[pool]["total"]
+            if task_instance.pool_slots > pool_total:
+                self.log.warning(
+                    "Not executing %s since requesting %s slots when total pool '%s' slots are %s.",
+                    task_instance,
+                    task_instance.pool_slots,
+                    pool,
+                    pool_total,
+                )

Review comment:
       WDYT?




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] eladkal commented on a change in pull request #20178: Add specific warning when Task asks for more slots than pool defined with

Posted by GitBox <gi...@apache.org>.
eladkal commented on a change in pull request #20178:
URL: https://github.com/apache/airflow/pull/20178#discussion_r767855271



##########
File path: airflow/jobs/scheduler_job.py
##########
@@ -327,6 +327,17 @@ def _executable_task_instances_to_queued(self, max_tis: int, session: Session =
                 self.log.warning("Tasks using non-existent pool '%s' will not be scheduled", pool)
                 continue
 
+            pool_total = pools[pool]["total"]
+            if task_instance.pool_slots > pool_total:
+                self.log.warning(
+                    "Not executing %s since requesting %s slots when total pool '%s' slots are %s.",
+                    task_instance,
+                    task_instance.pool_slots,
+                    pool,
+                    pool_total,
+                )

Review comment:
       applied in https://github.com/apache/airflow/pull/20178/commits/6a7a9657f6deb6c5c58f0f96ffb2143318f0877d




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #20178: Add specific warning when Task asks for more slots than pool defined with

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #20178:
URL: https://github.com/apache/airflow/pull/20178#issuecomment-995335360


   The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil merged pull request #20178: Add specific warning when Task asks for more slots than pool defined with

Posted by GitBox <gi...@apache.org>.
kaxil merged pull request #20178:
URL: https://github.com/apache/airflow/pull/20178


   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] kaxil commented on a change in pull request #20178: Add specific warning when Task asks for more slots than pool defined with

Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #20178:
URL: https://github.com/apache/airflow/pull/20178#discussion_r766790691



##########
File path: airflow/jobs/scheduler_job.py
##########
@@ -327,6 +327,13 @@ def _executable_task_instances_to_queued(self, max_tis: int, session: Session =
                 self.log.warning("Tasks using non-existent pool '%s' will not be scheduled", pool)
                 continue
 
+            pool_total = pools[pool]["total"]
+            if task_instance.pool_slots > pool_total:
+                self.log.warning(
+                    "Tasks requesting more slots than pool configured. pool '%s' will not be scheduled", pool
+                )

Review comment:
       ```suggestion
                   self.log.warning(
                       "Tasks requesting more slots (%s) than are configured in the pool. pool '%s' will not be scheduled", pool
                   )
   ```
   
   "pool '%s' will not be scheduled"" is not true though -- if there is another task that uses than pool and needs less slots it will go through




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] eladkal commented on a change in pull request #20178: Add specific warning when Task asks for more slots than pool defined with

Posted by GitBox <gi...@apache.org>.
eladkal commented on a change in pull request #20178:
URL: https://github.com/apache/airflow/pull/20178#discussion_r767275864



##########
File path: airflow/jobs/scheduler_job.py
##########
@@ -327,6 +327,13 @@ def _executable_task_instances_to_queued(self, max_tis: int, session: Session =
                 self.log.warning("Tasks using non-existent pool '%s' will not be scheduled", pool)
                 continue
 
+            pool_total = pools[pool]["total"]
+            if task_instance.pool_slots > pool_total:
+                self.log.warning(
+                    "Tasks requesting more slots than pool configured. pool '%s' will not be scheduled", pool
+                )

Review comment:
       improved the message in https://github.com/apache/airflow/pull/20178/commits/a5bee3a80ee03fb9b2a4aec79a6c50c8201a4d57




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org