You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by zsxwing <gi...@git.apache.org> on 2016/04/06 01:30:12 UTC

[GitHub] spark pull request: [SPARK-14416][Core]Add thread-safe comments fo...

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

    https://github.com/apache/spark/pull/12188#discussion_r58631408
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala ---
    @@ -68,23 +75,26 @@ class CoarseGrainedSchedulerBackend(scheduler: TaskSchedulerImpl, val rpcEnv: Rp
       // Executors we have requested the cluster manager to kill that have not died yet; maps
       // the executor ID to whether it was explicitly killed by the driver (and thus shouldn't
       // be considered an app-related failure).
    +  @GuardedBy("CoarseGrainedSchedulerBackend.this")
       private val executorsPendingToRemove = new HashMap[String, Boolean]
     
       // A map to store hostname with its possible task number running on it
    +  @GuardedBy("CoarseGrainedSchedulerBackend.this")
       protected var hostToLocalTaskCount: Map[String, Int] = Map.empty
     
       // The number of pending tasks which is locality required
    +  @GuardedBy("CoarseGrainedSchedulerBackend.this")
       protected var localityAwareTasks = 0
     
    -  // Executors that have been lost, but for which we don't yet know the real exit reason.
    -  protected val executorsPendingLossReason = new HashSet[String]
    -
       // The num of current max ExecutorId used to re-register appMaster
    -  protected var currentExecutorIdCounter = 0
    +  @volatile protected var currentExecutorIdCounter = 0
     
       class DriverEndpoint(override val rpcEnv: RpcEnv, sparkProperties: Seq[(String, String)])
         extends ThreadSafeRpcEndpoint with Logging {
     
    +    // Executors that have been lost, but for which we don't yet know the real exit reason.
    +    protected val executorsPendingLossReason = new HashSet[String]
    --- End diff --
    
    Move this into `DriverEndpoint` so that it's easy to know it's only accessed by `receive/receiveAndReply`


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

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