SameerMesiah97 opened a new pull request, #59160:
URL: https://github.com/apache/airflow/pull/59160
**Description**
This PR introduces a new `on_finish_action` mode, `delete_active_pod`, which
deletes pods that are in the 'Pending' or 'Running' state when the task
finishes. This allows Airflow to clean up zombie or orphaned pods that never
reach a terminal phase.
**Why introduce a new flag instead of changing `delete_succeeded_pod`**?
The behavior of `delete_succeeded_pod` was left unchanged to avoid breaking
backward compatibility. Changing its semantics to also delete active pods could
alter expectations for existing users who rely on the current behavior for
debugging or operational workflows. Introducing a new explicit flag ensures
clarity while preserving existing behavior.
**Tests**
The deletion logic inside process_pod_deletion previously had no direct unit
test coverage.
This PR adds a parameterized test that verifies pod deletion behavior across
all supported modes ('delete_pod', 'delete_succeeded_pod', and the new
'delete_active_pod') and pod phases ('Pending', 'Running', 'Completed and
Succeeded'). This ensures that the new flag behaves correctly and that existing
behavior remains stable.
**Documentation**
Docstring updated to refelct the new `delete_active_pod `option
**Related Issues**
closes: #59083
--
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]