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

   ### Apache Airflow Provider(s)
   
   cncf-kubernetes
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-cncf-kubernetes==10.12.4
   
   ### Apache Airflow version
   
   3.1.7
   
   ### Operating System
   
   debian
   
   ### Deployment
   
   Astronomer
   
   ### Deployment details
   
   _No response_
   
   ### What happened
   
   When using KubernetesPodOperator in deferrable mode (deferrable=True), 
manually marking a deferred task as failed or success from the Airflow UI does 
not delete the Kubernetes pod. The pod continues running indefinitely as an 
orphan.
   
   
   In sync (non-deferrable) mode, the on_kill() callback handles pod deletion. 
However, in deferrable mode the task runs via a trigger, and 
KubernetesPodTrigger has no cleanup() override to handle pod deletion when the 
trigger is cancelled.
   
   The pod is left running. The trigger is cancelled , but no cleanup is 
performed.
   
   ### What you think should happen instead
   
   The pod should be deleted according to the on_finish_action setting when a 
deferred task is manually killed.
   
   ### How to reproduce
   
   1. Create a KPO task with deferrable=True and on_finish_action="delete_pod"
   2. Trigger the DAG and wait for the task to enter "deferred" state
   3. Mark the task as "Failed" from the Airflow UI
   4. Check the Kubernetes pod -- it is still running
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] 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