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

Race condition in org.apache.spark.ComplexFutureAction.cancel

    XMLWordPrintableJSON

Details

    Description

      There is a chance that `thread` is null when calling `thread.interrupt()`.

        override def cancel(): Unit = this.synchronized {
          _cancelled = true
          if (thread != null) {
            thread.interrupt()
          }
        }
      

      Should put `thread = null` into a `synchronized` block to fix the race condition.

            try {
              p.success(func)
            } catch {
              case e: Exception => p.failure(e)
            } finally {
              thread = null
            }
      

      Attachments

        Activity

          People

            zsxwing Shixiong Zhu
            zsxwing Shixiong Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: