You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Reynold Xin (JIRA)" <ji...@apache.org> on 2014/11/11 09:29:35 UTC

[jira] [Closed] (SPARK-572) Forbid update of static mutable variables

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

Reynold Xin closed SPARK-572.
-----------------------------
    Resolution: Won't Fix

Closing this as won't fix since it is very hard to enforce and we do "abuse" it to run stateful computation.

> Forbid update of static mutable variables
> -----------------------------------------
>
>                 Key: SPARK-572
>                 URL: https://issues.apache.org/jira/browse/SPARK-572
>             Project: Spark
>          Issue Type: Improvement
>            Reporter: tjhunter
>
> Consider the following piece of code:
> <pre>
> object Foo {
>  var xx = -1
>  def main() {
>    xx = 1
>    val sc = new SparkContext(...)
>    sc.broadcast(xx)
>    sc.parallelize(0 to 10).map(i=>{ ... xx ...})
>  }
> }
> </pre>
> Can you guess the value of xx? It is 1 when you use the local scheduler and -1 when you use the mesos scheduler. Given the complications, it should probably just be forbidden for now...



--
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