dimberman commented on a change in pull request #10666:
URL: https://github.com/apache/airflow/pull/10666#discussion_r481206080
##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -441,3 +444,10 @@ def monitor_launched_pod(self, launcher, pod) ->
Tuple[State, Optional[str]]:
'Pod returned a failure: {state}'.format(state=final_state)
)
return final_state, result
+
+ def on_kill(self) -> None:
+ if self.pod:
+ pod: k8s.V1Pod = self.pod
+ namespace = pod.metadata.namespace
+ name = pod.metadata.name
+ self.client.delete_namespaced_pod(name=name, namespace=namespace,
grace_period_seconds=0)
Review comment:
@ashb grace_period_seconds is a recommendation, raising it doesn't
necessarily mean the ApiServer will wait that long. By setting it to 0 we are
telling the ApiServer "Delete this before doing anything else" rather than "get
around to it eventually"
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]