[Swift-commit] r5157 - SwiftApps/SwiftR/Swift/exec

tga at ci.uchicago.edu tga at ci.uchicago.edu
Thu Sep 22 15:46:29 CDT 2011


Author: tga
Date: 2011-09-22 15:46:29 -0500 (Thu, 22 Sep 2011)
New Revision: 5157

Modified:
   SwiftApps/SwiftR/Swift/exec/EvalRBatchPersistent.sh
Log:
Ensure mutex removed in case off error

Modified: SwiftApps/SwiftR/Swift/exec/EvalRBatchPersistent.sh
===================================================================
--- SwiftApps/SwiftR/Swift/exec/EvalRBatchPersistent.sh	2011-09-22 18:52:42 UTC (rev 5156)
+++ SwiftApps/SwiftR/Swift/exec/EvalRBatchPersistent.sh	2011-09-22 20:46:29 UTC (rev 5157)
@@ -174,7 +174,7 @@
 fi
 
 # Ready to talk to the server: send request and read response
-
+#FIXME: what if mutex isn't cleaned up?
 start_timeout
 while true; do
   mkdir $SLOTDIR/mutex
@@ -208,15 +208,15 @@
     res=$(cat < $SLOTDIR/fromR.fifo)
     echo DB: Got response: $res
 
+    rmdir $SLOTDIR/mutex
+
+    echo DB: Freed $SLOTDIR/mutex
+    
     # Test if R server reported an error
     if echo "$res" | grep -q '^ERROR:'
     then
         exit 1
     fi
-
-    rmdir $SLOTDIR/mutex
-
-    echo DB: Freed $SLOTDIR/mutex
 else
     stop_timeout
     echo "ERROR: Could not write to fifo ok"




More information about the Swift-commit mailing list