ifilonenko commented on a change in pull request #26586: [SPARK-29950][k8s] 
Blacklist deleted executors in K8S with dynamic allocation.
URL: https://github.com/apache/spark/pull/26586#discussion_r367164947
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/scheduler/cluster/CoarseGrainedSchedulerBackend.scala
 ##########
 @@ -207,15 +207,14 @@ class CoarseGrainedSchedulerBackend(scheduler: 
TaskSchedulerImpl, val rpcEnv: Rp
       case RegisterExecutor(executorId, executorRef, hostname, cores, logUrls,
           attributes, resources) =>
         if (executorDataMap.contains(executorId)) {
-          executorRef.send(RegisterExecutorFailed("Duplicate executor ID: " + 
executorId))
-          context.reply(true)
-        } else if (scheduler.nodeBlacklist.contains(hostname)) {
+          context.sendFailure(new IllegalStateException(s"Duplicate executor 
ID: $executorId"))
+        } else if (scheduler.nodeBlacklist.contains(hostname) ||
+            isBlacklisted(executorId, hostname)) {
           // If the cluster manager gives us an executor on a blacklisted node 
(because it
           // already started allocating those resources before we informed it 
of our blacklist,
           // or if it ignored our blacklist), then we reject that executor 
immediately.
           logInfo(s"Rejecting $executorId as it has been blacklisted.")
-          executorRef.send(RegisterExecutorFailed(s"Executor is blacklisted: 
$executorId"))
-          context.reply(true)
+          context.sendFailure(new IllegalStateException(s"Executor is 
blacklisted: $executorId"))
 
 Review comment:
   Is there a reason we would rather `sendFailure(_)` instead of the exiting 
the executor with a `RegisterExecutorFailed` message? 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to