spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sryza <>
Subject [GitHub] spark pull request: [SPARK-5529][CORE]Add expireDeadHosts in Heart...
Date Fri, 06 Feb 2015 00:11:33 GMT
Github user sryza commented on a diff in the pull request:
    --- Diff: core/src/main/scala/org/apache/spark/HeartbeatReceiver.scala ---
    @@ -17,33 +17,85 @@
     package org.apache.spark
    +import scala.concurrent.duration._
    +import scala.collection.mutable
    +import{Actor, Cancellable}
     import org.apache.spark.executor.TaskMetrics
    -import org.apache.spark.scheduler.TaskScheduler
    +import org.apache.spark.scheduler.{SlaveLost, TaskScheduler}
     import org.apache.spark.util.ActorLogReceive
      * A heartbeat from executors to the driver. This is a shared message used by several
    - * components to convey liveness or execution information for in-progress tasks.
    + * components to convey liveness or execution information for in-progress tasks. It will
    + * expiry the hosts that have no heartbeat for more than spark.executor.heartbeat.timeoutMs.
     private[spark] case class Heartbeat(
         executorId: String,
         taskMetrics: Array[(Long, TaskMetrics)], // taskId -> TaskMetrics
         blockManagerId: BlockManagerId)
    +private[spark] case object ExpireDeadHosts 
     private[spark] case class HeartbeatResponse(reregisterBlockManager: Boolean)
      * Lives in the driver to receive heartbeats from executors..
    -private[spark] class HeartbeatReceiver(scheduler: TaskScheduler)
    +private[spark] class HeartbeatReceiver(sc: SparkContext, scheduler: TaskScheduler)
       extends Actor with ActorLogReceive with Logging {
    +  val executorLastSeen = new mutable.HashMap[String, Long]
    +  val slaveTimeout = sc.conf.getLong("spark.executor.heartbeat.timeoutMs", 120 * 1000)
    +  val checkTimeoutInterval = sc.conf.getLong("spark.executor.heartbeat.timeoutIntervalMs",
    +  var timeoutCheckingTask: Cancellable = null
    +  override def preStart() {
    --- End diff --
    nit: methods with no return type should have `: Unit =`.  I know the old code wasn't like
this, but we're moving that convention.

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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message