Skip to content

Commit 832dd7a

Browse files
committed
check and delete expired log when complete process
1 parent 611ea30 commit 832dd7a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,12 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
682682
} finally {
683683
endProcessing(reader.rootPath)
684684
pendingReplayTasksCount.decrementAndGet()
685+
686+
val isExpired = scanTime + conf.get(MAX_LOG_AGE_S) * 1000 > clock.getTimeMillis()
687+
if (isExpired) {
688+
listing.delete(classOf[LogInfo], reader.rootPath.toString)
689+
deleteLog(fs, reader.rootPath)
690+
}
685691
}
686692
}
687693

0 commit comments

Comments
 (0)