Skip to content

Commit d99718e

Browse files
committed
Fixed SparkSubmit.scala and DiskBlockManager.scala in order to delete local directories of the driver of local-mode when external shuffle service is enabled
1 parent f9ed2b6 commit d99718e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ object SparkSubmit {
134134
}
135135
}
136136

137+
sysProps.put("spark.deploy.mode",
138+
deployMode match {
139+
case CLIENT => "client"
140+
case _ => "cluster"
141+
})
142+
137143
// The following modes are not supported or applicable
138144
(clusterManager, deployMode) match {
139145
case (MESOS, CLUSTER) =>

core/src/main/scala/org/apache/spark/storage/DiskBlockManager.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ private[spark] class DiskBlockManager(blockManager: BlockManager, conf: SparkCon
166166
/** Cleanup local dirs and stop shuffle sender. */
167167
private[spark] def stop() {
168168
// Only perform cleanup if an external service is not serving our shuffle files.
169-
if (!blockManager.externalShuffleServiceEnabled) {
169+
if (!blockManager.externalShuffleServiceEnabled ||
170+
(blockManager.blockManagerId.isDriver && conf.get("spark.deploy.mode") == "client")) {
170171
localDirs.foreach { localDir =>
171172
if (localDir.isDirectory() && localDir.exists()) {
172173
try {

0 commit comments

Comments
 (0)