Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2471#discussion_r18106863
  
    --- Diff: 
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala ---
    @@ -83,6 +96,25 @@ private[history] class FsHistoryProvider(conf: 
SparkConf) extends ApplicationHis
         }
       }
     
    +  /**
    +   * A background thread that periodically cleans event logs on disk.
    +   *
    +   * TODO: Add a mechanism to delete manually.
    +   */
    +  private val logCleaningThread = new Thread("LogCleaningThread") {
    +    override def run() = Utils.logUncaughtExceptions {
    +      while (true) {
    +        val now = System.currentTimeMillis()
    +        if (now - lastLogCleanTimeMs > CLEAN_INTERVAL_MS) {
    +          Thread.sleep(CLEAN_INTERVAL_MS)
    +        } else {
    +          Thread.sleep(lastLogCleanTimeMs + CLEAN_INTERVAL_MS - now)
    +        }
    +        cleanLogs()
    +      }
    +    }
    +  }
    +
    --- End diff --
    
    This looks a lot like `logCheckingThread`. Maybe it makes sense to make an 
abstract parent thread that both of these extend.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to