-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
[AIRFLOW-1156] BugFix: Unpausing a DAG with catchup=False creates an extra DAG run #8776
Conversation
Lol, one line fixes are the Best* Tests please :) (I'm sure you'd get around to it) * The worst. |
😄 Yeah - Looks like this bug was for a long time (possibly from the very start) !!! Found some old JIRAs. |
Oh that's funny because I struggled a lot on this to understand why there was a difference between the cron expressions and timdelta. That's why I started to use CRON instead. Didn't think it was a bug and very happy to know it is solved :) |
Is it possible to also prevent the run for the most recent scheduled interval? |
There is a difference between cron exp and time delta.It's not solved and I don't know if it's a bug. See discussion here: |
No, not yet |
The issue you are referring to is a different one. This OR brought parity between using timedelta and cron expression for "the number of DagRuns that are created at the very start" |
1 similar comment
The issue you are referring to is a different one. This OR brought parity between using timedelta and cron expression for "the number of DagRuns that are created at the very start" |
Is there an issue for this/can we create one? |
Yeah please check https://github.com/apache/airflow/issues if the issue exists, if not create one :) Thanks |
…pache#8776) (cherry picked from commit 3ad4f96)
The problem in AIRFLOW-1156 still seems to be an issue (at least in 1.10.x, and by the looks of the code, 2.x as well). Using a |
@mpeteuil could you create a new issue for that please? |
@mpeteuil yeah like Ash suggested please create a new issue with steps to reproduce. We fixed it in 1.10.11 |
Fixes the following issues:
If you create a DAG with catchup=False, when it is un-paused, it creates 2 dag runs. One for the most recent scheduled interval (expected) and one for the interval before that (unexpected).
Sample DAG:
Result:
2 DAG runs are created. 2018-11-18 and 108-11-17
Expected Result:
Only 1 DAG run should have been created (2018-11-18)
Cause:
This only occurs when using a timedelta as Schedule Interval (not when using Cron expression or Cron preset).
This is caused by the following block of code:
airflow/airflow/jobs/scheduler_job.py
Lines 578 to 595 in 6e4f5fa
Make sure to mark the boxes below before creating PR: [x]
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.
Read the Pull Request Guidelines for more information.