You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/04/11 22:51:27 UTC

[GitHub] [spark] MrBago commented on a change in pull request #24353: [SPARK-27446][R] Use existing spark conf if available.

MrBago commented on a change in pull request #24353: [SPARK-27446][R] Use existing spark conf if available.
URL: https://github.com/apache/spark/pull/24353#discussion_r274694824
 
 

 ##########
 File path: core/src/main/scala/org/apache/spark/api/r/RBackend.scala
 ##########
 @@ -47,7 +47,7 @@ private[spark] class RBackend {
   private[r] val jvmObjectTracker = new JVMObjectTracker
 
   def init(): (Int, RAuthHelper) = {
-    val conf = new SparkConf()
+    val conf = Option(SparkEnv.get).map(_.conf).getOrElse(new SparkConf())
 
 Review comment:
   I was trying to think of a way to test this, I was thinking maybe making a "vissableForTesting" method that returns the connection timeout and we can verify that passing the conf sets the correct value. But that seems somewhat indirect and requires an API just for testing.
   
   What do you think?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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