You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/12/08 19:52:21 UTC

[GitHub] [spark] dongjoon-hyun commented on a diff in pull request #38983: [SPARK-41447][CORE] Clean up expired event log files that don't exist in listing db

dongjoon-hyun commented on code in PR #38983:
URL: https://github.com/apache/spark/pull/38983#discussion_r1043761419


##########
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala:
##########
@@ -996,6 +996,21 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock)
       }
     }
 
+    // Delete log files that don't exist in listing database and exceed the configured max age.
+    Option(fs.listStatus(new Path(logDir))).map(_.toSeq).getOrElse(Nil)
+      .flatMap { entry => EventLogFileReader(fs, entry) }
+      .foreach { reader =>
+        try {
+          listing.read(classOf[LogInfo], reader.rootPath.toString)
+        } catch {
+          case _: NoSuchElementException =>
+            if (reader.modificationTime < maxTime) {

Review Comment:
   If this is a `time-based` deletion for unlisted logs, why don't we have at line 980?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org