-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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 dag.clear() to set multiple dags to running when necessary #15382
Conversation
5d093f4
to
18bb10c
Compare
967c96e
to
64b0b8d
Compare
64b0b8d
to
1afaf51
Compare
968f19b
to
89f6ed6
Compare
Closing/reopening to trigger build again. |
89f6ed6
to
937c170
Compare
What's the status of this? @yuqian90 are you just waiting for a final review? |
Yes. The PR has been tested and works well. Just waiting for reviews. |
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.
Please add back the removed fn (:sob:) then LGTM.
This fixes test_clear_dag in test_dag.py
937c170
to
b251a1d
Compare
Thanks. I put it back. |
The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest master at your convenience, or amend the last commit of the PR, and push it with --force-with-lease. |
Two random failures on MSSQL2019 only (where the DB didn't create the user -- /cc @potiuk @aneesh-joseph ) Merging this PR anyway |
Yeah. Some teething problems with MSSQL and @aneesh-joseph created the #16134 that might help! |
closes: #14260 related: #9824 When clearing task across dags using ExternalTaskMarker the dag state of the external DagRun is not set to active. So cleared tasks in the external dag will not automatically start if the DagRun is a Failed or Succeeded state. Two changes are made to fix the issue: Make clear_task_instances set DagRuns' state to dag_run_state for all the affected DagRuns. The filter for DagRun in clear_task_instances is fixed too. Previously, it made an assumption that execution_dates for all the dag_ids are the same, which is not always correct. test_external_task_marker_clear_activate is added to make sure the fix does the right thing. (cherry picked from commit 2bca8a5)
…e#15382) closes: apache#14260 related: apache#9824 When clearing task across dags using ExternalTaskMarker the dag state of the external DagRun is not set to active. So cleared tasks in the external dag will not automatically start if the DagRun is a Failed or Succeeded state. apache#9824 tried to fix a similar issue for subdag. But it did not fix ExternalTaskMarker. This PR fixes both. Two changes are made to fix the issue: Make clear_task_instances set DagRuns' state to dag_run_state for all the affected DagRuns. The filter for DagRun in clear_task_instances is fixed too. Previously, it made an assumption that execution_dates for all the dag_ids are the same, which is not always correct. test_external_task_marker_clear_activate is added to make sure the fix does the right thing. (cherry picked from commit 2bca8a5)
closes: #14260 related: #9824 When clearing task across dags using ExternalTaskMarker the dag state of the external DagRun is not set to active. So cleared tasks in the external dag will not automatically start if the DagRun is a Failed or Succeeded state. Two changes are made to fix the issue: Make clear_task_instances set DagRuns' state to dag_run_state for all the affected DagRuns. The filter for DagRun in clear_task_instances is fixed too. Previously, it made an assumption that execution_dates for all the dag_ids are the same, which is not always correct. test_external_task_marker_clear_activate is added to make sure the fix does the right thing. (cherry picked from commit 2bca8a5)
Do we have an idea of when this fix will be released and made available via PyPI? |
It's cherry-picked to 2.1 branch and we are just about to release 2.1.1 with it (we are in feature-freeze/final test mode for it). Expect final release in ~ 1 week if everything goes well. |
closes: #14260
related: #9824
When clearing task across dags using
ExternalTaskMarker
the dag state of the external DagRun is not set to active. So cleared tasks in the external dag will not automatically start if theDagRun
is a Failed or Succeeded state.#9824 tried to fix a similar issue for subdag. But it did not fix
ExternalTaskMarker
. This PR fixes both.Two changes are made to fix the issue:
clear_task_instances
set DagRuns' state todag_run_state
for all the affected DagRuns.DagRun
inclear_task_instances
is fixed too. Previously, it made an assumption that execution_dates for all the dag_ids are the same, which is not always correct.test_external_task_marker_clear_activate
is added to make sure the fix does the right thing.