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

    https://github.com/apache/spark/pull/3711#discussion_r22679665
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala
 ---
    @@ -344,12 +354,20 @@ private[spark] class MesosSchedulerBackend(
     
       override def frameworkMessage(d: SchedulerDriver, e: ExecutorID, s: 
SlaveID, b: Array[Byte]) {}
     
    +  /**
    +   * Remove executor associated with slaveId in a thread safe manner.
    +   */
    +  private def removeExecutor(slaveId: String) = {
    +    synchronized {
    --- End diff --
    
    Can you explain a bit what this synchronization is trying to protect? I did 
a small audit of this class and I found the synchronization is a bit all over 
the place. For instance we don't seem to hold any locks when adding to 
`slaveIdsWithExecutors` but we do hold a lock when removing from it. Seems a 
bit odd.


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