Skip to content
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

Clearing a task group re-triggers task instances that were not selected for clearing #44234

Open
1 of 2 tasks
okayhooni opened this issue Nov 21, 2024 · 0 comments
Open
1 of 2 tasks
Labels
area:core area:TaskGroup kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet

Comments

@okayhooni
Copy link
Contributor

Apache Airflow version

Other Airflow 2 version (please specify below)

If "Other Airflow 2 version" selected, which one?

2.8.4

What happened?

We received a report from a user of our Airflow system stating that when they cleared a task group (without selecting the "Past" or "Future" options), task instances from other DagRuns, which were newly added to the task group but not selected for clearing, were also re-triggered.

Upon reviewing the audit logs, we confirmed that the parameters passed during the clear operation indicated that both the "Past" and "Future" options were set to False.

Although we were unable to reproduce the issue in our testing environment, we have confirmed a bug where tasks newly added to a task group (which were not included in the "Affected Tasks" list of the clear UI) are still executed unexpectedly.

image image

We suspect that this issue might be caused by the filtering of tasks to be cleared, particularly due to the fact that only the current state of the task group is stored in the metadata database, rather than the historical changes, which may have led to this bug.

tasks_to_set_state = [task for task in task_group.iter_tasks() if isinstance(task, BaseOperator)]

Additionally, we reviewed the latest code in the main branch but could not find any fixes related to this bug.

What you think should happen instead?

Only the task instances within the target task group and the specified DagRun should be cleared.

How to reproduce

Step 1) Create a DAG with task groups and generate multiple DagRuns (with catchup=True).
Step 2) Add a new task to a specific task group (and also add new tasks to other task groups).
Step 3) Clear a specific task group via the web UI.

Operating System

Debian GNU/Linux 12 (bookworm)

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@okayhooni okayhooni added area:core kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core area:TaskGroup kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet
Projects
None yet
Development

No branches or pull requests

1 participant