Skip to content

Commit c83d426

Browse files
committed
Address the comments
Change-Id: I1b61dd676a5344c8e69a3d7d5268aa343bd1bf75
1 parent 11a14a3 commit c83d426

File tree

1 file changed

+5
-2
lines changed
  • resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn

1 file changed

+5
-2
lines changed

resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,15 @@ private[spark] class Client(
193193
* Cleanup application staging directory.
194194
*/
195195
private def cleanupStagingDir(appId: ApplicationId): Unit = {
196+
if (sparkConf.get(PRESERVE_STAGING_FILES)) {
197+
return
198+
}
199+
196200
def cleanupStagingDirInternal(): Unit = {
197201
val stagingDirPath = new Path(appStagingBaseDir, getAppStagingDir(appId))
198202
try {
199-
val preserveFiles = sparkConf.get(PRESERVE_STAGING_FILES)
200203
val fs = stagingDirPath.getFileSystem(hadoopConf)
201-
if (!preserveFiles && fs.delete(stagingDirPath, true)) {
204+
if (fs.delete(stagingDirPath, true)) {
202205
logInfo(s"Deleted staging directory $stagingDirPath")
203206
}
204207
} catch {

0 commit comments

Comments
 (0)