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

Make SparkContext thread-safe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Invalid
    • 0.5.0, 0.5.1, 0.5.2, 0.6.0, 0.6.1, 0.6.2, 0.7.0, 0.7.1, 0.7.2, 0.7.3
    • None
    • Spark Core
    • None

    Description

      SparkEnv (used by SparkContext) is not thread-safe and it causes issues with scala's Futures and parrallel collections.
      For example, this will not work:

      val f = Futures.future({
        sc.textFile("hdfs://....")
      })
      f.apply()
      

      Workaround for now:

      val f = Futures.future({
        SparkEnv.set(sc.env)
        sc.textFile("hdfs://....")
      })
      f.apply()
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            tjhunter tjhunter (Inactive)
            Votes:
            4 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: