Github user zsxwing commented on a diff in the pull request:
https://github.com/apache/spark/pull/5268#discussion_r27448846
--- Diff: core/src/main/scala/org/apache/spark/HeartbeatReceiver.scala ---
@@ -91,17 +103,25 @@ private[spark] class HeartbeatReceiver(sc:
SparkContext, scheduler: TaskSchedule
scheduler.executorLost(executorId, SlaveLost("Executor heartbeat "
+
s"timed out after ${now - lastSeenMs} ms"))
if (sc.supportDynamicAllocation) {
- sc.killExecutor(executorId)
+ // Asynchronously kill the executor to avoid blocking the
current thread
--- End diff --
No.
Here is the execution of `killExecutor`:
SparkContext.killExecutor -> SparkContext.killExecutors ->
CoarseGrainedSchedulerBackend.killExecutors ->
CoarseGrainedSchedulerBackend.doKillExecutors
If CoarseGrainedSchedulerBackend is YarnSchedulerBackend, it will
`askWithReply` KillExecutors to YarnSchedulerEndpoint, and
YarnSchedulerEndpoint will `askWithReply` KillExecutors to AM.
Because AM and YarnSchedulerEndpoint are not in the same node in
yarn-client mode, it needs to go through the network and wait for a reply.
Since it's a blocking method, I need to call it asynchronously in another
thread.
---
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]