File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -110,9 +110,19 @@ sparkR.init <- function(
110110 mainClass = " edu.berkeley.cs.amplab.sparkr.SparkRBackend" ,
111111 args = as.character(sparkRBackendPort ),
112112 javaOpts = paste(" -Xmx" , sparkMem , sep = " " ))
113- Sys.sleep(2 ) # Wait for backend to come up
113+
114+ cat(" Waiting JVM bring up ...\n " )
115+ while (TRUE ) {
116+ if (! connExists(.sparkREnv )) {
117+ Sys.sleep(1 )
118+ cat(" ." )
119+ connectBackend(" localhost" , sparkRBackendPort ) # Connect to it
120+ } else {
121+ cat(" ok.\n " )
122+ break
123+ }
124+ }
114125 .sparkREnv $ sparkRBackendPort <- sparkRBackendPort
115- connectBackend(" localhost" , sparkRBackendPort ) # Connect to it
116126
117127 if (nchar(sparkHome ) != 0 ) {
118128 sparkHome <- normalizePath(sparkHome )
You can’t perform that action at this time.
0 commit comments