atosatto opened a new pull request, #52898:
URL: https://github.com/apache/spark/pull/52898

   ### What changes were proposed in this pull request?
   
   The current code handling deletion of Failed or Succeeded driver Pods is 
calling the Kubernetes API to delete objects until either the Kubelet as 
started the termination the Pod (the status of the object is terminating).
   
   However, depending on configuration, the ExecutorPodsLifecycleManager loop 
might run multiple times before the Kubelet starts the deletion of the Pod 
object, resulting in un-necessary DELETE calls to the Kubernetes API, which are 
particularly expensive since they are served from Etcd.
   
   Following the Kubernetes API specifications in 
https://kubernetes.io/docs/reference/using-api/api-concepts/
   
   > When a client first sends a delete to request the removal of a resource, 
the .metadata.deletionTimestamp is set to the current time. Once the 
.metadata.deletionTimestamp is set, external controllers that act on finalizers 
may start performing their cleanup work at any time, in any order.
   
   we can assume that whenever the deletionTimestamp is set on a Pod, this will 
be eventually terminated without the need of additional DELETE calls.
   
   ### Why are the changes needed?
   
   This change is required to remove the need of redundant API calls agains the 
Kubernetes API that at scale might lead to excessive load against Etcd.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   This patch includes unit-tests.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to