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

    https://github.com/apache/spark/pull/6935#discussion_r47005788
  
    --- Diff: 
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala ---
    @@ -430,8 +519,54 @@ private[history] class FsHistoryProvider(conf: 
SparkConf, clock: Clock)
         }
         newIterator.foreach(addIfAbsent)
         oldIterator.foreach(addIfAbsent)
    +    mergedApps
    +  }
    +
    +
    +  /**
    +   * Scan through all incomplete applications, and check for any that have 
changed.
    +   *
    +   * After the scan, if there were any updated attempts, [[applications]] 
is updated
    +   * with the new values.
    +   *
    +   * 1. No attempt to replay the application is made; this scan is a low 
cost operation.
    +   * 2. As this overwrites [[applications]] with a new value, it must not 
run concurrently
    +   */
    +  private[history] def scanAndUpdateIncompleteAttemptInfo(): Unit = {
    +    val now = System.currentTimeMillis();
    +    val newAttempts: Iterable[FsApplicationAttemptInfo] = applications
    +        .filter( e => !e._2.completed)
    +        .flatMap { e =>
    +          // build list of (false, attempt) or (true, attempt') values
    +          e._2.attempts.flatMap { attempt: FsApplicationAttemptInfo =>
    +            val path = new Path(logDir, attempt.logPath)
    +            try {
    +              val status = fs.getFileStatus(path)
    +              val size = getLogSize(status).getOrElse(-1L)
    +              val aS = attempt.fileSize
    +              if (size > aS) {
    --- End diff --
    
    also, I think should block might be a bit clearer if `attempt` were renamed 
to `prevInfo`, it took me a bit to figure out what was going on.


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