HeartSaVioR commented on a change in pull request #27208: [SPARK-30481][CORE] 
Integrate event log compactor into Spark History Server
URL: https://github.com/apache/spark/pull/27208#discussion_r368287534
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala
 ##########
 @@ -720,6 +691,20 @@ private[history] class FsHistoryProvider(conf: SparkConf, 
clock: Clock)
     } finally {
       endProcessing(rootPath)
       pendingReplayTasksCount.decrementAndGet()
+
+      // triggering another task for compaction task
+      try {
+        processing(rootPath)
+        val task: Runnable = () => compact(reader)
+        replayExecutor.submit(task)
+      } catch {
+        // let the iteration over the updated entries break, since an 
exception on
+        // replayExecutor.submit (..) indicates the ExecutorService is unable
+        // to take any more submissions at this time
+        case e: Exception =>
+          logError(s"Exception while submitting task for compaction", e)
+          endProcessing(rootPath)
 
 Review comment:
   I think checkLog seems to have a bug - if replayExecutor.submit fails and 
throws an exception, the log is not removed from `processing` which would block 
processing for the log in both `checkLogs` and `cleanLogs`. 
   
   I'm OK to fix it here as well, or fix it in another PR to avoid mixing up.

----------------------------------------------------------------
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