You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by vanzin <gi...@git.apache.org> on 2017/12/04 22:24:15 UTC
[GitHub] spark pull request #19770: [SPARK-21571][WEB UI] Spark history server leaves...
Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/19770#discussion_r154784139
--- Diff: core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala ---
@@ -616,23 +620,9 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
listing.write(newApp)
}
- toDelete.foreach { attempt =>
- val logPath = new Path(logDir, attempt.logPath)
- try {
- listing.delete(classOf[LogInfo], logPath.toString())
- } catch {
- case _: NoSuchElementException =>
- logDebug(s"Log info entry for $logPath not found.")
- }
- try {
- fs.delete(logPath, true)
- } catch {
- case e: AccessControlException =>
- logInfo(s"No permission to delete ${attempt.logPath}, ignoring.")
- case t: IOException =>
- logError(s"IOException in cleaning ${attempt.logPath}", t)
- }
- }
+ toDelete
+ .map(attempt => new Path(logDir, attempt.logPath))
+ .foreach(logPath => deleteLogInfo(logPath))
--- End diff --
`.foreach { logPath =>` (or `.foreach(deleteLogInfo)`).
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org