vanzin commented on a change in pull request #25797: [SPARK-29043][Core] 
Improve the concurrent performance of History Server
URL: https://github.com/apache/spark/pull/25797#discussion_r347691988
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala
 ##########
 @@ -797,6 +819,43 @@ private[history] class FsHistoryProvider(conf: SparkConf, 
clock: Clock)
     }
   }
 
+  /**
+   * Check and delete specified event log according to the max log age defined 
by the user.
+   */
+  private def checkAndCleanLog(logPath: String): Unit = Utils.tryLog {
+    val maxTime = clock.getTimeMillis() - conf.get(MAX_LOG_AGE_S) * 1000
+    val expiredLog = Try {
+      val log = listing.read(classOf[LogInfo], logPath)
+      if (log.lastProcessed < maxTime) Some(log) else None
 
 Review comment:
   This is wrong. The attempt may be expired but the `lastProcessed` time may 
be recent. So you always need to check the app data itself for expiration.
   
   `lastProcessed` is only used for log files that never record the app ID 
(e.g. the driver crashed soon after creating the file).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to