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

Executor should not fail stage if killed task throws non-interrupted exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.2.0
    • 2.2.0
    • Spark Core
    • None

    Description

      This is reproducible as follows. Run the following, and then use SparkContext.killTaskAttempt to kill one of the tasks. The entire stage will fail since we threw a RuntimeException instead of InterruptedException.

      We should probably unconditionally return TaskKilled instead of TaskFailed if the task was killed by the driver, regardless of the actual exception thrown.

      spark.range(100).repartition(100).foreach { i =>
        try {
          Thread.sleep(10000000)
        } catch {
          case t: InterruptedException =>
            throw new RuntimeException(t)
        }
      }
      

      Based on the code in TaskSetManager, I think this also affects kills of speculative tasks. However, since the number of speculated tasks is few, and usually you need to fail a task a few times before the stage is cancelled, probably no-one noticed this in production.

      Attachments

        Issue Links

          Activity

            People

              ekhliang Eric Liang
              ekhliang Eric Liang
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: