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

    https://github.com/apache/spark/pull/6394#discussion_r34835128
  
    --- Diff: core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala 
---
    @@ -872,6 +872,25 @@ class DAGScheduler(
         // will be posted, which should always come after a corresponding 
SparkListenerStageSubmitted
         // event.
         stage.latestInfo = StageInfo.fromStage(stage, 
Some(partitionsToCompute.size))
    +    val taskIdToLocations = try {
    +      stage match {
    +        case s: ShuffleMapStage =>
    +          partitionsToCompute.map { id => (id, getPreferredLocs(stage.rdd, 
id))}.toMap
    +        case s: ResultStage =>
    +          val job = s.resultOfJob.get
    +          partitionsToCompute.map { id =>
    +            val p = job.partitions(id)
    +            (id, getPreferredLocs(stage.rdd, p))
    +          }.toMap
    +      }
    +    } catch {
    +      case NonFatal(e) =>
    +        abortStage(stage, s"Task creation failed: 
$e\n${e.getStackTraceString}")
    +        runningStages -= stage
    +        return
    +    }
    +    stage.latestInfo.taskLocalityPreferences = 
Some(taskIdToLocations.values.toSeq)
    --- End diff --
    
    I wouldn't expect developers to be creating StageInfos, only reading them, 
so I don't think changing the developer API in this way is a big concern.


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