shrprasa commented on code in PR #40128:
URL: https://github.com/apache/spark/pull/40128#discussion_r1124903174


##########
resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/KubernetesClientApplication.scala:
##########
@@ -143,6 +144,9 @@ private[spark] class Client(
         logError("Please check \"kubectl auth can-i create [resource]\" 
first." +
           " It should be yes. And please also check your feature step 
implementation.")
         kubernetesClient.resourceList(preKubernetesResources: _*).delete()
+        // register shutdownhook for cleaning up the upload dir only

Review Comment:
   The reason we need to register only in exception cases is that the cleanup 
of files and directory under file upload path should happen on client side only 
if job submission fails. If we register early, and job is submitted with 
   spark.kubernetes.submission.waitAppCompletion conf value as false, shutdown 
hook will be called as soon as app submission completes and the files will be 
deleted. This will case the job to fail as driver will not be able to find 
these files. 
   



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