[Swift-commit] r4072 - SwiftApps/SwiftR/Swift/R

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Wed Feb 9 13:17:27 CST 2011


Author: tga
Date: 2011-02-09 13:17:27 -0600 (Wed, 09 Feb 2011)
New Revision: 4072

Modified:
   SwiftApps/SwiftR/Swift/R/Apply.R
Log:
Removed write timeout by default: this behaved poorly when the swift workers took some time to start up.


Modified: SwiftApps/SwiftR/Swift/R/Apply.R
===================================================================
--- SwiftApps/SwiftR/Swift/R/Apply.R	2011-02-08 23:07:24 UTC (rev 4071)
+++ SwiftApps/SwiftR/Swift/R/Apply.R	2011-02-09 19:17:27 UTC (rev 4072)
@@ -87,7 +87,7 @@
     requestPipeName=file.path(swiftServerDir,"requestpipe")
     resultPipeName=file.path(swiftServerDir,"resultpipe")
     # Try sending: this function will cause error if it fails
-    sendServiceRequest(requestPipeName, reqdir, server)
+    sendServiceRequest(requestPipeName, reqdir, server, timeout=timeout)
     
     res <- getServiceResponse(resultPipeName, timeout)
     # Check that the message was correct
@@ -244,7 +244,7 @@
   }
 }
 
-sendServiceRequest <- function (requestPipeName, reqdir, server=NULL) {
+sendServiceRequest <- function (requestPipeName, reqdir, server=NULL,  timeout=NULL) {
     # fifo will block irrecoverably if there is no reader on the
     # other end of the requestPipe.  This is bad.  The swift worker
     # script is responsible for deleting the request pipe when it
@@ -254,11 +254,10 @@
         # there is a race condition here if the fifo disappears in
         # between checking for existence and opening the fifo, but
         # the timeout will catch that unlikely case
-        writeTimeout <- 4000
         success <- writeFifo(requestPipeName,paste(reqdir,"\n",sep=""), 
-                timeout=writeTimeout)
+                timeout=timeout)
         if (! success) {
-            stop(paste("timeout of", writeTimeout, 
+            stop(paste("timeout of", timeout, 
                 "ms exceeded when attempting to",
                 "rendezvous with  SwiftR server of type", server, ".\n",
                 "Maybe it is not running or it has crashed"))




More information about the Swift-commit mailing list