Github user gliptak commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9263#discussion_r43250312
  
    --- Diff: python/pyspark/mllib/tests.py ---
    @@ -76,7 +76,8 @@
         pass
     
     ser = PickleSerializer()
    -sc = SparkContext('local[4]', "MLlib tests")
    +conf = SparkConf().set("spark.driver.allowMultipleContexts", "true")
    --- End diff --
    
    Reviewing the tests.py-s 
    
    
https://github.com/apache/spark/blob/master/python/pyspark/streaming/tests.py
    
    initiates SparkContext differently:
    
    ```
        @classmethod
        def setUpClass(cls):
            class_name = cls.__name__
            conf = SparkConf().set("spark.default.parallelism", 1)
            cls.sc = SparkContext(appName=class_name, conf=conf)
            cls.sc.setCheckpointDir("/tmp")
    
        @classmethod
        def tearDownClass(cls):
            cls.sc.stop()
            # Clean up in the JVM just in case there has been some issues in 
Python API
            try:
                jSparkContextOption = SparkContext._jvm.SparkContext.get()
                if jSparkContextOption.nonEmpty():
                    jSparkContextOption.get().stop()
            except:
                pass
    ```
    
    Could this approach be retrofitted into 
https://github.com/apache/spark/blob/master/python/pyspark/mllib/tests.py to 
allow for concurrency?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to