hussein-awala commented on code in PR #34500:
URL: https://github.com/apache/airflow/pull/34500#discussion_r1335236053
##########
airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -822,8 +823,12 @@ def process_pod_deletion(self, pod: k8s.V1Pod, *,
reraise=True):
self.log.info("Deleting pod: %s", pod.metadata.name)
self.pod_manager.delete_pod(pod)
elif should_delete_pod and istio_enabled:
- self.log.info("Deleting istio-proxy sidecar inside %s: ",
pod.metadata.name)
- self.kill_istio_sidecar(pod)
+ if container_is_running(pod, self.ISTIO_CONTAINER_NAME):
+ self.log.info("Deleting istio-proxy sidecar inside %s:
", pod.metadata.name)
+ self.kill_istio_sidecar(pod)
+ self.pod_manager.delete_pod(pod)
+ else:
+ self.pod_manager.delete_pod(pod)
Review Comment:
Indeed, when we attempt to terminate the pod, all the containers receive a
SIGTERM signal. They manage this through a signal handler. Kubernetes will wait
a maximum of `graceperiod` seconds before resorting to a SIGKILL to forcefully
terminate them. Given that the KPO has the `termination_grace_period` argument,
I concur with Jed's suggestion with a small change; no need for `if
should_delete_pod and not istio_enabled` and `if should_delete_pod and
istio_enabled`, all this block could be deleted, and we can kill the pod when
`should_delete_pod` is Truee regardless the value of `istio_enabled`.
--
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]