Fix catchup by limiting queued dagrun creation using max_active_runs#18897
Merged
Conversation
ephraimbuddy
commented
Oct 11, 2021
Contributor
Author
|
Most of the codes here are from previous versions |
ashb
previously requested changes
Oct 12, 2021
ashb
left a comment
Member
There was a problem hiding this comment.
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
624932c to
7faba6e
Compare
2 tasks
7faba6e to
e8dbd28
Compare
uranusjr
reviewed
Oct 18, 2021
e8dbd28 to
2384f48
Compare
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>
27bb21e to
38ba356
Compare
uranusjr
approved these changes
Oct 20, 2021
jedcunningham
approved these changes
Oct 20, 2021
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
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.