-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Have KubernetesPodOperator call on_pod_cleanup callbacks for failed tasks
#49441
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
base: main
Are you sure you want to change the base?
Have KubernetesPodOperator call on_pod_cleanup callbacks for failed tasks
#49441
Conversation
f6bc1cc to
ae51de7
Compare
|
can you change the description of the PR to reference the correct issue? (you referencing now to the current PR :)) |
|
according to those lines I think the skipping on the |
My interpretation of those comments is that cleanup code should be skipped when the task has been killed, which is still the case with this change. |
|
Got it — looks good! |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
That sounds reasonable. I'm about to go on vacation, but will try to get back to this when I return. |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
|
Sorry, Git bot, I've been busy. 😛 Still hoping to find time to complete this at some point. |
|
Hi @sean-rose, we also observed this behavior. Thank you for contributing 👍 |
closes: #49441
Currently the
on_pod_cleanupcallbacks are only called if thecleanupmethod completes successfully, but thecleanupmethod raises exceptions if the task failed. This changesKubernetesPodOperatorto call theon_pod_cleanupcallbacks from within thecleanupmethod before it raises such exceptions.^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.