Skip to content

Conversation

@kncatalan
Copy link
Contributor

Why


This is a pull request based on the raised issue #54379.
Summary of the issue:
A UI implementation of a workaround that seeks to prevent duplicate runs of the same task instance by adding another confirmation pop-up before re-running tasks in a running, restarting, or up-for-retry state.

What


The pop-up confirmation works by checking the state of the task instance when requesting a rerun. If the task instance is in a running, restarting, or up-for-retry state, then it will display a second confirmation pop-up. Otherwise, it will not show the second pop-up confirmation dialog.

Here is a sample of the modal confirmation dialog when a task is running:

chrome_tBE1fBd92x.mp4

Here is a sample where the modal will not display when trying to re-run a task in other states other than running, restarting, and up-for-retry:

chrome_YoFXuWnYl3.mp4

Here is another, longer sample that simulates 2 users trying to re-run the same task:

axhSsOHNIc.mp4

@boring-cyborg
Copy link

boring-cyborg bot commented Sep 15, 2025

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Sep 15, 2025
@bbovenzi
Copy link
Contributor

The backend should return an error on an erroneous second clear action. Let's not do a UI-only bandaid solution.

Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks for the PR.

As mentioned by Brent, we can do that on the server side.

We can add a flag to the server, default behavior stays the same. (we don't want to break the API backward compat), and the front-end set the appropriate flag value to prevent reclearing if dag is already runing.

@pierrejeambrun pierrejeambrun added this to the Airflow 3.1.1 milestone Sep 17, 2025
@pierrejeambrun
Copy link
Member

Also we should probably do something similar for Runs.

@kncatalan kncatalan force-pushed the add-modal-confirmation-dialog branch from 7f8daa2 to fb4e814 Compare September 17, 2025 23:53
Copy link
Member

@jason810496 jason810496 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for the PR!
The tests are required for the Airflow Core change, thanks!

Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, a few more comments.

…ent_running_tasks' addition to ti, instead, it is passed as a parameter in clearTaskInstance.
Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. A few last comments and we should be good to merge.

Copy link
Member

@jason810496 jason810496 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update and please not be hesitate to resolve the addressed comments.

The test for airflow-core/src/airflow/models/taskinstance.py change is required.

@kncatalan
Copy link
Contributor Author

Hello,
This comment will be an update for this PR

This is how the PR currently looks like:

chrome_VkmgN56gJw.mp4

Since the current state of this PR is a little bit different from the expected outcome stated in the PR description, I will make a new PR that uses this PR's code. The will be new PR's goal will still be the same however in the description, instead of a modal pop-up, it will be a checkbox instead.

@bbovenzi
Copy link
Contributor

bbovenzi commented Oct 9, 2025

So should we close this PR in favor of the other one?

@kncatalan
Copy link
Contributor Author

So should we close this PR in favor of the other one?

If possible, yes.

@pierrejeambrun
Copy link
Member

Closing as requested @KlarenceNicolasCatalan

@kaxil kaxil removed this from the Airflow 3.1.1 milestone Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants