You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Josh Rosen (JIRA)" <ji...@apache.org> on 2014/11/01 08:48:33 UTC

[jira] [Updated] (SPARK-4180) SparkContext constructor should throw exception if another SparkContext is already running

     [ https://issues.apache.org/jira/browse/SPARK-4180?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Josh Rosen updated SPARK-4180:
------------------------------
    Description: 
Spark does not currently support multiple concurrently-running SparkContexts in the same JVM (see SPARK-2243).  Therefore, SparkContext's constructor should throw an exception if there is an active SparkContext that has not been shut down via {{stop()}}.

PySpark already does this, but the Scala SparkContext should do the same thing.  The current behavior with multiple active contexts is unspecified / not understood and it may be the source of confusing errors (see the user error report in SPARK-4080, for example).

This should be pretty easy to add: just add a {{activeSparkContext}} field to the SparkContext companion object and {{synchronize}} on it in the constructor and {{stop()}} methods; see PySpark's {{context.py}} file for an example of this approach.

  was:
Spark does not currently support multiple concurrently-running SparkContexts in the same JVM (see SPARK-2243).  Therefore, SparkContext's constructor should throw an exception if there is an active SparkContext that has not been shut down via {{stop()}}.

PySpark already does this, but the Scala SparkContext should do the same thing.  The current behavior with multiple active contexts is unspecified / not understood and it may be the source of confusing errors (see SPARK-4080, for example).

This should be pretty easy to add: just add a {{activeSparkContext}} field to the SparkContext companion object and {{synchronize}} on it in the constructor and {{stop()}} methods; see PySpark's {{context.py}} file for an example of this approach.


> SparkContext constructor should throw exception if another SparkContext is already running
> ------------------------------------------------------------------------------------------
>
>                 Key: SPARK-4180
>                 URL: https://issues.apache.org/jira/browse/SPARK-4180
>             Project: Spark
>          Issue Type: Bug
>          Components: Spark Core
>            Reporter: Josh Rosen
>            Priority: Blocker
>              Labels: starter
>
> Spark does not currently support multiple concurrently-running SparkContexts in the same JVM (see SPARK-2243).  Therefore, SparkContext's constructor should throw an exception if there is an active SparkContext that has not been shut down via {{stop()}}.
> PySpark already does this, but the Scala SparkContext should do the same thing.  The current behavior with multiple active contexts is unspecified / not understood and it may be the source of confusing errors (see the user error report in SPARK-4080, for example).
> This should be pretty easy to add: just add a {{activeSparkContext}} field to the SparkContext companion object and {{synchronize}} on it in the constructor and {{stop()}} methods; see PySpark's {{context.py}} file for an example of this approach.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org