Skip to content

Ensure teardown tasks are executed when DAG run is set to failed#45530

Merged
jscheffl merged 4 commits intoapache:mainfrom
jscheffl:bugfix/ensure-teardown-is-executed-when-dag-set-failed
Jan 11, 2025
Merged

Ensure teardown tasks are executed when DAG run is set to failed#45530
jscheffl merged 4 commits intoapache:mainfrom
jscheffl:bugfix/ensure-teardown-is-executed-when-dag-set-failed

Conversation

@jscheffl
Copy link
Copy Markdown
Contributor

@jscheffl jscheffl commented Jan 9, 2025

Related to Slack topic: https://apache-airflow.slack.com/archives/CCR6P6JRL/p1736440079894049

We noticed that if a DAG run is set to failed, all tasks are either set to failed or skipped. But if Teardown Tasks are used in a DAG, they are not executed. This could lead to infrastructure or external dependencies not properly cleaned-up.

This PR changes the behavior and does NOT fail/skip teardown tasks if a DAG is set to failed.
A side effect as consequence might be that the DAG is after the call NOT failed, else if it would set it to failed, then any teardown task (even if not skipped/failed) will not scheduled anymore.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AIP-52 Automatic setup and teardown tasks area:API Airflow's REST/HTTP API type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants