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

    https://github.com/apache/spark/pull/15986#discussion_r89411506
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/TaskSchedulerImpl.scala ---
    @@ -335,31 +337,31 @@ private[spark] class TaskSchedulerImpl(
         var reason: Option[ExecutorLossReason] = None
         synchronized {
           try {
    -        if (state == TaskState.LOST && taskIdToExecutorId.contains(tid)) {
    -          // We lost this entire executor, so remember that it's gone
    -          val execId = taskIdToExecutorId(tid)
    -
    -          if (executorIdToTaskCount.contains(execId)) {
    +        taskIdToTaskSetManager.get(tid) match {
    +          case Some(taskSet) if state == TaskState.LOST =>
    --- End diff --
    
    Can you just do "case Some(taskSet) =>" here, and then make a new block for 
the "if state == TaskState.LOST" and later the "else"? I find that easier to 
read than having this case statement and then the later "case Some(taskSet)" 
(since it's more obvious that we're doing some stuff, if the task set exists, 
and throwing an error otherwise)


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