toree-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject incubator-toree git commit: [TOREE-396] Add connection timeout when R connects to Spark
Date Thu, 07 Sep 2017 01:31:56 GMT
Repository: incubator-toree
Updated Branches:
  refs/heads/master 3cedc10b6 -> 9cdc29860


[TOREE-396] Add connection timeout when R connects to Spark

Looks like in Spark 2.1, the timeout param to sparkRConnect
no longer has a default value.

Closes #138


Project: http://git-wip-us.apache.org/repos/asf/incubator-toree/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-toree/commit/9cdc2986
Tree: http://git-wip-us.apache.org/repos/asf/incubator-toree/tree/9cdc2986
Diff: http://git-wip-us.apache.org/repos/asf/incubator-toree/diff/9cdc2986

Branch: refs/heads/master
Commit: 9cdc298604a28e31e0e3d873d811948a989a5311
Parents: 3cedc10
Author: Michele Lamarca <michele.lamarca@brightcomputing.com>
Authored: Mon Sep 4 17:38:28 2017 +0200
Committer: Luciano Resende <lresende@apache.org>
Committed: Wed Sep 6 18:23:54 2017 -0700

----------------------------------------------------------------------
 sparkr-interpreter/src/main/resources/kernelR/sparkr_runner.R | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/9cdc2986/sparkr-interpreter/src/main/resources/kernelR/sparkr_runner.R
----------------------------------------------------------------------
diff --git a/sparkr-interpreter/src/main/resources/kernelR/sparkr_runner.R b/sparkr-interpreter/src/main/resources/kernelR/sparkr_runner.R
index dab58f7..a4fe3c7 100644
--- a/sparkr-interpreter/src/main/resources/kernelR/sparkr_runner.R
+++ b/sparkr-interpreter/src/main/resources/kernelR/sparkr_runner.R
@@ -60,9 +60,10 @@ sparkR.connect <- function() {
   print(c("ExistingPort:", existingPort))
 
   # Connect to the backend service
+  connectionTimeout <- as.numeric(Sys.getenv("SPARKR_BACKEND_CONNECTION_TIMEOUT", "6000"))
   .sparkREnv$backendPort <- backendPort
   tryCatch({
-    SparkR:::connectBackend("localhost", backendPort)
+    SparkR:::connectBackend("localhost", backendPort, connectionTimeout)
   }, error = function(err) {
     stop("Failed to connect JVM: ", err)
   })


Mime
View raw message