Skip to content

Conversation

@KevinYang21
Copy link
Owner

@KevinYang21 KevinYang21 commented Sep 17, 2018

Jira

  • My PR addresses the following Airflow Jira issues and references them in the PR title.

Description

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

  • 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

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

Commits

  • 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":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters (not including Jira issue reference)
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

Documentation

  • 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

  • Passes git diff upstream/master -u -- "*.py" | flake8 --diff

@KevinYang21 KevinYang21 force-pushed the kevin_yang_parallelize_enqueue branch from d3b14dd to 5e42363 Compare September 17, 2018 06:32
@KevinYang21 KevinYang21 force-pushed the kevin_yang_decouple_dag_parsing branch from eb8abb1 to da03da2 Compare September 17, 2018 07:53
@KevinYang21 KevinYang21 force-pushed the kevin_yang_parallelize_enqueue branch 2 times, most recently from 3ab4972 to 72bfa7c Compare September 17, 2018 08:19
@KevinYang21 KevinYang21 force-pushed the kevin_yang_decouple_dag_parsing branch from da03da2 to 932bf4f Compare September 17, 2018 18:57
@KevinYang21 KevinYang21 force-pushed the kevin_yang_parallelize_enqueue branch 5 times, most recently from 9a4e8e6 to 53a26bb Compare September 18, 2018 10:13
@KevinYang21 KevinYang21 force-pushed the kevin_yang_decouple_dag_parsing branch from 932bf4f to c45cc19 Compare September 18, 2018 19:14
@KevinYang21 KevinYang21 force-pushed the kevin_yang_parallelize_enqueue branch 8 times, most recently from 7383b00 to 8541440 Compare September 20, 2018 19:09
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (kevin_yang_decouple_dag_parsing@c45cc19). Click here to learn what that means.
The diff coverage is 83.82%.

Impacted file tree graph

@@                        Coverage Diff                         @@
##             kevin_yang_decouple_dag_parsing       #4   +/-   ##
==================================================================
  Coverage                                   ?   76.29%           
==================================================================
  Files                                      ?      198           
  Lines                                      ?    16194           
  Branches                                   ?        0           
==================================================================
  Hits                                       ?    12355           
  Misses                                     ?     3839           
  Partials                                   ?        0
Impacted Files Coverage Δ
airflow/utils/timeout.py 78.57% <100%> (ø)
airflow/executors/base_executor.py 95.16% <100%> (ø)
airflow/executors/celery_executor.py 77.24% <69.64%> (ø)
airflow/utils/dag_processing.py 58.52% <91.66%> (ø)
airflow/jobs.py 77.33% <93.93%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c45cc19...8541440. Read the comment docs.

@KevinYang21 KevinYang21 changed the title [WIP][AIRFLOW-2761] Parallelize enqueue in celery executor [BLOCKED][AIRFLOW-2761] Parallelize enqueue in celery executor Sep 20, 2018
@KevinYang21 KevinYang21 force-pushed the kevin_yang_decouple_dag_parsing branch 7 times, most recently from d869e48 to 07cafb1 Compare September 28, 2018 08:53
@KevinYang21 KevinYang21 force-pushed the kevin_yang_decouple_dag_parsing branch from 07cafb1 to e3d984a Compare October 11, 2018 00:08
@KevinYang21 KevinYang21 force-pushed the kevin_yang_decouple_dag_parsing branch 5 times, most recently from 86f1b5e to 0ca9713 Compare October 12, 2018 20:40
@KevinYang21 KevinYang21 force-pushed the kevin_yang_parallelize_enqueue branch 5 times, most recently from 2e815c8 to 564c6b5 Compare October 13, 2018 00:44
@KevinYang21 KevinYang21 force-pushed the kevin_yang_parallelize_enqueue branch from 564c6b5 to bd6ab2b Compare October 15, 2018 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants