holdenk commented on code in PR #58619:
URL: https://github.com/apache/spark/pull/58619#discussion_r4042601711


##########
core/src/main/scala/org/apache/spark/deploy/worker/Worker.scala:
##########
@@ -622,7 +622,17 @@ private[deploy] class Worker(
             val localRootDirs = Utils.getOrCreateLocalRootDirs(conf)
             val dirs = localRootDirs.flatMap { dir =>
               try {
-                val appDir = Utils.createDirectory(dir, namePrefix = 
"executor")
+                // Nest executor local dirs under a per-application directory 
(the app id as
+                // a path segment) so the external shuffle service can require 
registered
+                // localDirs to be scoped to the registering application.
+                val appIdDir = new File(dir, appId)
+                appIdDir.mkdirs()
+                if (!appIdDir.isDirectory) {
+                  throw new IOException(s"Failed to create directory 
$appIdDir")
+                }
+                Utils.chmod700(appIdDir)
+                val appDir = Utils.createDirectory(appIdDir.getAbsolutePath(),
+                  namePrefix = "executor")
                 Utils.chmod700(appDir)
                 Some(appDir.getAbsolutePath())

Review Comment:
   Good point on using `Utils.createDirectory(appIdDir)` & thanks for the point 
on the K8s shuffle recovery. I think in local cluster mode we don't have to 
worry about the standalone shuffle service though.



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