[jbosscache-commits] JBoss Cache SVN: r5002 - in cache-bench-fwk/trunk: src/org/cachebench/smartfrog and 1 other directory.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Sat Jan 5 16:51:31 EST 2008


Author: mircea.markus
Date: 2008-01-05 16:51:31 -0500 (Sat, 05 Jan 2008)
New Revision: 5002

Modified:
   cache-bench-fwk/trunk/runNode.sh
   cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java
Log:
increased the memory size for the JVM

Modified: cache-bench-fwk/trunk/runNode.sh
===================================================================
--- cache-bench-fwk/trunk/runNode.sh	2008-01-05 21:25:23 UTC (rev 5001)
+++ cache-bench-fwk/trunk/runNode.sh	2008-01-05 21:51:31 UTC (rev 5002)
@@ -20,6 +20,9 @@
 
 export SYS_PROPS="-DcurrentIndex=$1 -Dorg.cachebench.debug=$CACHE_DEBUG -Djava.net.preferIPv4Stack=$preferIPv4Stack"
 
+#first kill all the exisiting processes as they might interfere with the new ones/ not sure this works on cygwin
+ps -fe | grep CacheBenchmarkRunner | cut -c 10-20 | xargs kill
+
 #libraries needed by the fwk, add them to the classpath
 for JAR in ./lib/*
 do

Modified: cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java
===================================================================
--- cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java	2008-01-05 21:25:23 UTC (rev 5001)
+++ cache-bench-fwk/trunk/src/org/cachebench/smartfrog/CacheBenchmarkPrim.java	2008-01-05 21:51:31 UTC (rev 5002)
@@ -7,10 +7,7 @@
 import org.smartfrog.sfcore.prim.PrimImpl;
 import org.smartfrog.sfcore.prim.TerminationRecord;
 
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.InputStreamReader;
-import java.io.LineNumberReader;
+import java.io.*;
 import java.rmi.RemoteException;
 
 /**
@@ -59,17 +56,34 @@
             try
             {
                runBenchmark();
-            } catch (Exception e)
+            } catch (SmartFrogException e)
             {
-               throw new IllegalStateException(e);
+                  log.error("Unexpected error:" + e.getMessage(), e);
+
+            } catch (IOException e)
+            {
+               log.warn("Does the script have X rights?", e);
+               terminate(e);
+
+            } catch (InterruptedException e)
+            {
+               log.err("This is quite strange", e);
+               terminate(e);
             }
          }
+         private void terminate(Exception e)
+         {
+            TerminationRecord terminationRecord = new TerminationRecord(TerminationRecord.ABNORMAL , "terminated the benchmark " +
+                  getNodeDescription(),null, e);
+            sfTerminate(terminationRecord);
+
+         }
       };
       thread.start();
    }
 
    private void runBenchmark()
-         throws SmartFrogException, RemoteException
+         throws SmartFrogException, IOException, InterruptedException
    {
       super.sfStart();
       log.trace("Entered sfStart...");
@@ -78,8 +92,6 @@
          log.info("Not processing this node" + getNodeDescription());
          return;
       }
-      try
-      {
          String command = scriptToExec + " " + nodeIndex + " " + cacheDistribution + " -DclusterSize=" + clusterSize;
          log.info("Executing command: " + command);
          Process process = Runtime.getRuntime().exec(command, null, toRunIn);
@@ -96,12 +108,6 @@
          {
             sfTerminate(new TerminationRecord(TerminationRecord.ABNORMAL, "we have an NOT zero exit code: " + exitValue, null));
          }
-      }
-      catch (Exception e)
-      {
-         log.error("Unexpected error:" + e.getMessage(), e);
-         throw new RemoteException("Unexpected error",e);
-      }
       log.debug("Terminating the tests...");
       TerminationRecord terminationRecord = new TerminationRecord(TerminationRecord.NORMAL, "terminated the benchmark " +
             getNodeDescription(), null);




More information about the jbosscache-commits mailing list