Skip to content

Commit 8bb70d8

Browse files
author
Venkata krishnan Sowrirajan
committed
Handle multiple lambda applications creating local dirs
1 parent cf4d11d commit 8bb70d8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/src/main/scala/org/apache/spark/util/Utils.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ private[spark] object Utils extends Logging {
289289
maxAttempts + " attempts!")
290290
}
291291
try {
292-
if (namePrefix.contains("executor")) {
292+
if (!namePrefix.equalsIgnoreCase("executor-driver") && namePrefix.contains("executor")) {
293293
dir = new File(root, namePrefix + "-" + nonNegativeHash(namePrefix).toString.reverse)
294294
} else {
295295
dir = new File(root, namePrefix + "-" + UUID.randomUUID.toString)
@@ -794,6 +794,10 @@ private[spark] object Utils extends Logging {
794794
// Note that we don't want this if the shuffle service is enabled because we want to
795795
// continue to serve shuffle files after the executors that wrote them have already exited.
796796
Array(conf.getenv("MESOS_DIRECTORY"))
797+
} else if (conf.get("spark.master").contains("lambda")) {
798+
val sparkApplicationId = conf.get("spark.app.id")
799+
val lambdaTmp = System.getProperty("java.io.tmpdir").split(",").map(tmp => tmp.concat(s"/${sparkApplicationId}"))
800+
lambdaTmp
797801
} else {
798802
if (conf.getenv("MESOS_DIRECTORY") != null && shuffleServiceEnabled) {
799803
logInfo("MESOS_DIRECTORY available but not using provided Mesos sandbox because " +

0 commit comments

Comments
 (0)