Github user kayousterhout commented on a diff in the pull request: https://github.com/apache/spark/pull/8887#discussion_r42439726 --- Diff: core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala --- @@ -482,21 +482,28 @@ private[spark] class TaskSchedulerImpl( } } - /** Remove an executor from all our data structures and mark it as lost */ + /** + * Remove an executor from all our data structures and mark it as lost. If the executor's loss + * reason is not yet known, do not yet remove its association with its host. + */ private def removeExecutor(executorId: String, reason: ExecutorLossReason) { activeExecutorIds -= executorId val host = executorIdToHost(executorId) val execs = executorsByHost.getOrElse(host, new HashSet) - execs -= executorId - if (execs.isEmpty) { - executorsByHost -= host - for (rack <- getRackForHost(host); hosts <- hostsByRack.get(rack)) { - hosts -= host - if (hosts.isEmpty) { - hostsByRack -= rack + + if (reason != LossReasonPending) { --- End diff -- But executorIdToHost is updated outside of your check, on line 507, so it seems like even with this change host will be null? But this question is mostly irrelevant given my other question about why not just do this the simpler way I proposed?
--- 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