-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix catchup by limiting queued dagrun creation using max_active_runs #18897
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boring-cyborg
bot
added
the
area:Scheduler
including HA (high availability) scheduler
label
Oct 11, 2021
ephraimbuddy
commented
Oct 11, 2021
Most of the codes here are from previous versions |
ashb
previously requested changes
Oct 12, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs more tests please:
- Check that when there are n-1th dag_runs and we call _schedule_dag_run to create the n-th dag run that the relevant date columns are set to null
- Check that when at max active runs (inc queued) that parsing the dag does not reset the columns
- Check that when a dag run was in running state but that it's final task is completed that _schedule_dag_runs correctly sets the next_dagrun columns
ephraimbuddy
force-pushed
the
fix-catchup
branch
from
October 13, 2021 11:11
624932c
to
7faba6e
Compare
2 tasks
ephraimbuddy
force-pushed
the
fix-catchup
branch
from
October 18, 2021 12:44
7faba6e
to
e8dbd28
Compare
uranusjr
reviewed
Oct 18, 2021
ephraimbuddy
force-pushed
the
fix-catchup
branch
from
October 19, 2021 09:49
e8dbd28
to
2384f48
Compare
ephraimbuddy
added
the
full tests needed
We need to run full set of tests for this PR to merge
label
Oct 19, 2021
uranusjr
reviewed
Oct 19, 2021
uranusjr
reviewed
Oct 19, 2021
Currently, when catchup is True, we create a lot of dagruns limited by max_queued_runs_per_dag setting. This is not efficient as some dagruns takes longer to run. This PR brings back the old behaviour of not creating dagruns once max_active_runs is reached thereby solving the catchup issue. Now, the dagruns appears as though they were created in running state improve code and add more tests fixup! improve code and add more tests Add information about removing of max_queued_runs_per_dag add method for active runs remove comment deduplicate dag_ids Update airflow/models/dagrun.py Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com> Update airflow/jobs/scheduler_job.py Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com> Update airflow/jobs/scheduler_job.py Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
ephraimbuddy
force-pushed
the
fix-catchup
branch
from
October 20, 2021 09:24
27bb21e
to
38ba356
Compare
uranusjr
approved these changes
Oct 20, 2021
jedcunningham
approved these changes
Oct 20, 2021
jedcunningham
dismissed
ashb’s stale review
October 20, 2021 20:32
Tests have been added and feedback addressed.
jedcunningham
pushed a commit
that referenced
this pull request
Oct 20, 2021
…18897) Currently, when catchup is True, we create a lot of dagruns limited by max_queued_runs_per_dag setting. This is not efficient as some dagruns takes longer to run. This PR brings back the old behavior of not creating dagruns once max_active_runs is reached thereby solving the catchup issue. Now, the dagruns appears as though they were created in running state (cherry picked from commit 05eea00)
jedcunningham
pushed a commit
to astronomer/airflow
that referenced
this pull request
Oct 26, 2021
…pache#18897) Currently, when catchup is True, we create a lot of dagruns limited by max_queued_runs_per_dag setting. This is not efficient as some dagruns takes longer to run. This PR brings back the old behavior of not creating dagruns once max_active_runs is reached thereby solving the catchup issue. Now, the dagruns appears as though they were created in running state (cherry picked from commit 05eea00)
sharon2719
pushed a commit
to sharon2719/airflow
that referenced
this pull request
Oct 27, 2021
…pache#18897) Currently, when catchup is True, we create a lot of dagruns limited by max_queued_runs_per_dag setting. This is not efficient as some dagruns takes longer to run. This PR brings back the old behavior of not creating dagruns once max_active_runs is reached thereby solving the catchup issue. Now, the dagruns appears as though they were created in running state
37 tasks
jedcunningham
pushed a commit
to astronomer/airflow
that referenced
this pull request
Oct 27, 2021
…pache#18897) Currently, when catchup is True, we create a lot of dagruns limited by max_queued_runs_per_dag setting. This is not efficient as some dagruns takes longer to run. This PR brings back the old behavior of not creating dagruns once max_active_runs is reached thereby solving the catchup issue. Now, the dagruns appears as though they were created in running state (cherry picked from commit 05eea00)
kaxil
pushed a commit
that referenced
this pull request
Nov 1, 2021
Fix #19304, and also an issue on scheduling a DAG's first-ever run introduced in #18897. We could fix it outside this function, but if `next_dagrun` is None, the next run's data interval is supposed to be None in the first place, so checking inside this function just makes sense. closes #19343 closes #19304
jedcunningham
pushed a commit
to astronomer/airflow
that referenced
this pull request
Nov 1, 2021
) Fix apache#19304, and also an issue on scheduling a DAG's first-ever run introduced in apache#18897. We could fix it outside this function, but if `next_dagrun` is None, the next run's data interval is supposed to be None in the first place, so checking inside this function just makes sense. closes apache#19343 closes apache#19304 (cherry picked from commit dc4dcaa)
jedcunningham
pushed a commit
to astronomer/airflow
that referenced
this pull request
Nov 1, 2021
) Fix apache#19304, and also an issue on scheduling a DAG's first-ever run introduced in apache#18897. We could fix it outside this function, but if `next_dagrun` is None, the next run's data interval is supposed to be None in the first place, so checking inside this function just makes sense. closes apache#19343 closes apache#19304 (cherry picked from commit dc4dcaa)
kaxil
pushed a commit
that referenced
this pull request
Nov 2, 2021
Fix #19304, and also an issue on scheduling a DAG's first-ever run introduced in #18897. We could fix it outside this function, but if `next_dagrun` is None, the next run's data interval is supposed to be None in the first place, so checking inside this function just makes sense. closes #19343 closes #19304 (cherry picked from commit dc4dcaa)
jedcunningham
pushed a commit
that referenced
this pull request
Nov 3, 2021
Fix #19304, and also an issue on scheduling a DAG's first-ever run introduced in #18897. We could fix it outside this function, but if `next_dagrun` is None, the next run's data interval is supposed to be None in the first place, so checking inside this function just makes sense. closes #19343 closes #19304 (cherry picked from commit dc4dcaa)
This was referenced Nov 10, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area:Scheduler
including HA (high availability) scheduler
full tests needed
We need to run full set of tests for this PR to merge
type:bug-fix
Changelog: Bug Fixes
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, when catchup is True, we create a lot of dagruns limited by
max_queued_runs_per_dag setting. This is not efficient as some dagruns takes
longer to run.
This PR brings back the old behaviour of not creating dagruns once max_active_runs
is reached thereby solving the catchup issue.
Now, the dagruns appears as though they were created in running state
Closes: #18487
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.