Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-13371

TaskSetManager.dequeueSpeculativeTask compares Option[String] and String directly.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.2, 1.6.0
    • Fix Version/s: 1.6.1, 2.0.0
    • Component/s: Scheduler
    • Labels:
      None

      Description

      TaskSetManager.dequeueSpeculativeTask compares Option[String] and String directly.
      

      Ths code: https://github.com/apache/spark/blob/87abcf7df921a5937fdb2bae8bfb30bfabc4970a/core/src/main/scala/org/apache/spark/scheduler/TaskSetManager.scala#L344

       if (TaskLocality.isAllowed(locality, TaskLocality.RACK_LOCAL)) {
          for (rack <- sched.getRackForHost(host)) {
            for (index <- speculatableTasks if canRunOnHost(index)) {
              val racks = tasks(index).preferredLocations.map(_.host).map(sched.getRackForHost)
              // racks: Seq[Option[String]] and rack: String
              if (racks.contains(rack)) {
                speculatableTasks -= index
                return Some((index, TaskLocality.RACK_LOCAL))
              }
            }
          }
        }
      

        Attachments

          Activity

            People

            • Assignee:
              srowen Sean Owen
              Reporter:
              gq Guoqiang Li
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: