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

    https://github.com/apache/spark/pull/8078#discussion_r36684901
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala
 ---
    @@ -422,16 +422,19 @@ class CoarseGrainedSchedulerBackend(scheduler: 
TaskSchedulerImpl, val rpcEnv: Rp
           logWarning(s"Executor to kill $id does not exist!")
         }
     
    +    // If an executor is already pending to be removed, do not kill it 
again (SPARK-9795)
    +    val executorsToKill = knownExecutors.filter { id => 
!executorsPendingToRemove.contains(id) }
    --- End diff --
    
    Nit: It looks like `unknownExecutors` is useful only for that one log 
statement. If we don't need that log line, we could reduce the number of set 
copies and traversals. How about something like this (this is less scala-like, 
but reduces the number of traversals and copies):
    
    ```
    val knownExecutors = new HashSet[String]
    executorsIds.foreach { id =>
      if (executorDataMap.contains(id)) {
        knownExecutors ++ id
      }
    }
    ```


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to