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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]