[ 
https://issues.apache.org/jira/browse/AIRFLOW-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16698050#comment-16698050
 ] 

ASF GitHub Bot commented on AIRFLOW-2761:
-----------------------------------------

KevinYang21 opened a new pull request #4234: [WIP][AIRFLOW-2761] Parallelize 
enqueue in celery executor
URL: https://github.com/apache/incubator-airflow/pull/4234
 
 
   ### Jira
   
   - [x] My PR addresses the following [Airflow 
Jira](https://issues.apache.org/jira/browse/AIRFLOW-2761) issues and references 
them in the PR title.
   
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI 
changes:
   The change is branch off from this PR: 
https://github.com/apache/incubator-airflow/pull/3873
   
   Summary of major changes:
   - Celery executor will create a process pool to enqueue celery task in 
parallel.
   - Scheduler job will not pass TaskInstance to executor when trying to queue 
command, instead it passes SimpleTaskInstance, in order to enable parallel 
enqueuing.
   - Scheduler no longer checks task instance state before enqueuing because 
worker already checks task instance state before executing. Our cluster has 
been requeuing everything for a long time and there should be no risk removing 
that redundant check.
   
   
   
   ### Tests
   
   - [x] My PR adds the following unit tests __OR__ does not need testing for 
this extremely good reason:
   
   
tests/executors/test_celery_executor.py:TestCeleryExecutor.test_error_sending_task
   tests/jobs.py:SchedulerJobTest.test_change_state_for_tasks_failed_to_execute
   
   Also updated existing failing unit test.
   
   Before:
   Before (32k tasks should run on 13:30 but didn't get >30k running tasks 
until 13:41):
   ![screen shot 2018-08-31 at 3 26 48 
pm](https://user-images.githubusercontent.com/7818710/45852558-3a8b0980-bcf5-11e8-803f-d98f56c81a9c.png)
   
   
   
   After (32k tasks should run on 15:10 and got them all running at 15:14):
   ![screen shot 2018-08-31 at 3 26 11 
pm](https://user-images.githubusercontent.com/7818710/45852419-97d28b00-bcf4-11e8-89b2-79481dbf8030.png)
   
   
   ### Commits
   
   - [x] My commits all reference Jira issues in their subject lines, and I 
have squashed multiple commits if they address the same issue. In addition, my 
commits follow the guidelines from "[How to write a good git commit 
message](http://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [x] In case of new functionality, my PR adds documentation that describes 
how to use it.
     - When adding new operators/hooks/sensors, the autoclass documentation 
generation needs to be added.
   
   ### Code Quality
   
   - [x] Passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Parallelize Celery Executor enqueuing
> -------------------------------------
>
>                 Key: AIRFLOW-2761
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-2761
>             Project: Apache Airflow
>          Issue Type: Improvement
>            Reporter: Kevin Yang
>            Priority: Major
>
> Currently celery executor enqueues in an async fashion but still doing that 
> in a single process loop. This can slows down scheduler loop and creates 
> scheduling delay if we have large # of task to schedule in a short time, e.g. 
> UTC midnight we need to schedule large # of sensors in a short period.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to