Github user zsxwing commented on the issue:

    https://github.com/apache/spark/pull/15481
  
    @mridulm `ask` is very cheap. It just puts the serialized message into a 
buffer. The current codes now need to duplicate the codes and as @viirya 
pointed out, it misses 
`executorDataMap.get(executorId).foreach(_.executorEndpoint.send(StopExecutor))`.
    
    How about just the following changes? I agreed that `removeExecutor` 
doesn't need to be in the `synchronized` block.
    ```
      protected def reset(): Unit = {
        val executors = synchronized {
          numPendingExecutors = 0
          executorsPendingToRemove.clear()
          Set() ++ executorDataMap.keys
        }
    
        // Remove all the lingering executors that should be removed but not 
yet. The reason might be
        // because (1) disconnected event is not yet received; (2) executors 
die silently.
        executors.foreach { eid =>
          removeExecutor(eid, SlaveLost("Stale executor after cluster manager 
re-registered."))
        }
      }
    ```


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