jscheffl opened a new issue, #68184:
URL: https://github.com/apache/airflow/issues/68184

   ### Under which category would you file this issue?
   
   Airflow Core
   
   ### Apache Airflow version
   
   main (but also on 3.2.x)
   
   ### What happened and how to reproduce it?
   
   Airflow 2 introduced "Setup/Teardown tasks" with the promise to run always 
when also tasks are cleared or mark as failed. See also 
https://airflow.apache.org/docs/apache-airflow/stable/howto/setup-and-teardown.html:
   
   > Key features of setup and teardown tasks:
   >
   > - If you clear a task, its setups and teardowns will be cleared.
   
   But in a case where I want to restart an individual task (and not all 
content downstream the UI does not show setup or teardown:
   
   <img width="1374" height="858" alt="Image" 
src="https://github.com/user-attachments/assets/625fc001-5bb3-47df-b6d4-7b32bf627548";
 />
   
   I _think_ it is okay to hide them but if the user clears a task then also 
alongside automatically all setup-/and teardown should be cleared irrespective 
of what the user selected. This was how it was made in Airflow 2.
   
   Workaround is only to keep "Downstream" selected as task filter and then 
manually un-selecting all not needed tasks except the setup/teardown (which are 
correctly listed there).
   
   Second thing which (potentially) falls into the same problem is that if in 
UI the "mark for success/mark failed" is used and the default "Downstream" task 
selection is made:
   
   <img width="1348" height="936" alt="Image" 
src="https://github.com/user-attachments/assets/1eb7e600-8f21-41c8-a904-5ed008fa9cee";
 />
   
   ...then as a consequence all downstream tasks are marked success/fail as 
selected. But Success/Fail should **not** be set for downstream teardown tasks 
which belong to the running instances as else some setup (e.g. infrastructure) 
would stay w/o stopped. See this for example:
   
   <img width="1309" height="460" alt="Image" 
src="https://github.com/user-attachments/assets/e89d5b45-1171-400f-94d8-1f65c007a79a";
 />
   
   This defeats the purpose and w/o manual clearing of respective teardown the 
provisioned infrastructure stays online. The core promise of teardown tasks is 
void.Note that this was working in Airflow 2.
   
   > Key features of setup and teardown tasks:
   >
   > - Teardown will also be carried out if the Dag run is manually set to 
“failed” or “success” to ensure resources will be cleaned-up.
   
   Note: Can be re-produced via `example_setup_teardown` Dag main.
   
   ### What you think should happen instead?
   
   If individual tasks are cleared which have a setup-/teardown around, the 
promise to also clear these shoudl always be given, irrespective of what the 
user selects
   (In my view okay if this is resolved/fixed in the backend, visiúally 
"perfect" would be to keep the tasks in the dialog and have them read-only 
always checked but sounds like a lot of UX complexity as individual task 
selection dependecy in UI would need to be known)
   
   Same applies to the second (okay to split to a separate bug) if tasks are 
manually set to failed, relevant teardown should not marked as failed if the 
setup was running.
   
   ### Operating System
   
   _No response_
   
   ### Deployment
   
   None
   
   ### Apache Airflow Provider(s)
   
   _No response_
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Official Helm Chart version
   
   Not Applicable
   
   ### Kubernetes Version
   
   _No response_
   
   ### Helm Chart configuration
   
   _No response_
   
   ### Docker Image customizations
   
   _No response_
   
   ### Anything else?
   
   Interesting that nobody else reported this until now, probably is broken 
since 3.0.0.
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to