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

    https://github.com/apache/spark/pull/8887#discussion_r41882345
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala ---
    @@ -459,46 +492,30 @@ private[spark] class TaskSchedulerImpl(
       }
     
       override def executorLost(executorId: String, reason: 
ExecutorLossReason): Unit = {
    -    var failedExecutor: Option[String] = None
    +    removeExecutor(executorId, reason)
    +  }
     
    +  /** Remove all information related to the executor. */
    +  private def removeExecutor(executorId: String, reason: 
ExecutorLossReason): Unit = {
    +    disableExecutor(executorId)
         synchronized {
    -      if (activeExecutorIds.contains(executorId)) {
    -        val hostPort = executorIdToHost(executorId)
    -        logError("Lost executor %s on %s: %s".format(executorId, hostPort, 
reason))
    -        removeExecutor(executorId, reason)
    -        failedExecutor = Some(executorId)
    -      } else {
    +      executorIdToHost.remove(executorId) match {
    +        case Some(host) =>
    +          val msg = s"Lost executor $executorId on $host: $reason"
    +          reason match {
    +            case ExecutorExited(_, isNormalExit, _) if isNormalExit => 
logInfo(msg)
    +            case _ => logError(msg)
    +          }
    +          rootPool.executorLost(executorId, host, reason)
    +
    +        case None =>
              // We may get multiple executorLost() calls with different loss 
reasons. For example, one
              // may be triggered by a dropped connection from the slave while 
another may be a report
              // of executor termination from Mesos. We produce log messages 
for both so we eventually
              // report the termination reason.
    -         logError("Lost an executor " + executorId + " (already removed): 
" + reason)
    -      }
    -    }
    -    // Call dagScheduler.executorLost without holding the lock on this to 
prevent deadlock
    --- End diff --
    
    perhaps keep this comment, code got moved above.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to