airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject git commit: removing thread-pool and adding sleep before reconnect
Date Thu, 02 Oct 2014 14:27:54 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 44dc03b2e -> 2bbeb7a99


removing thread-pool and adding sleep before reconnect


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/2bbeb7a9
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/2bbeb7a9
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/2bbeb7a9

Branch: refs/heads/master
Commit: 2bbeb7a996652ab812ffeed96b7944ab6dbfe80d
Parents: 44dc03b
Author: lahiru <lahiru@apache.org>
Authored: Thu Oct 2 10:27:49 2014 -0400
Committer: lahiru <lahiru@apache.org>
Committed: Thu Oct 2 10:27:49 2014 -0400

----------------------------------------------------------------------
 .../client/samples/CreateLaunchExperiment.java  | 24 +++++-----
 .../monitor/impl/pull/qstat/HPCPullMonitor.java |  5 +--
 .../gsi/ssh/impl/GSISSHAbstractCluster.java     | 47 ++++++++++++++++++++
 3 files changed, 60 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/2bbeb7a9/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
----------------------------------------------------------------------
diff --git a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
index fcbec41..ad05d92 100644
--- a/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
+++ b/airavata-api/airavata-client-sdks/java-client-samples/src/main/java/org/apache/airavata/client/samples/CreateLaunchExperiment.java
@@ -46,7 +46,7 @@ public class CreateLaunchExperiment {
     private static final String DEFAULT_USER = "default.registry.user";
     private static final String DEFAULT_GATEWAY = "default.registry.gateway";
     private static Airavata.Client airavataClient;
-    private static String echoAppId = "Echo_a96fcc6c-70d8-4557-974f-def8205e8e75";
+    private static String echoAppId = "Echo_f99c94a4-a663-492e-bce6-266e77c06978";
     private static String wrfAppId = "WRF_5f097c9c-7066-49ec-aed7-4e39607b3adc";
     private static String amberAppId = "Amber_89906be6-5678-49a6-9d04-a0604fbdef2e";
 
@@ -56,14 +56,13 @@ public class CreateLaunchExperiment {
     private static String br2HostName = "bigred2.uits.iu.edu";
 
     public static void main(String[] args) {
-        for (int i = 0; i < 1; i++)
             try {
-            airavataClient = AiravataClientFactory.createAiravataClient(THRIFT_SERVER_HOST,
THRIFT_SERVER_PORT);
-            System.out.println("API version is " + airavataClient.getAPIVersion());
+                airavataClient = AiravataClientFactory.createAiravataClient(THRIFT_SERVER_HOST,
THRIFT_SERVER_PORT);
+                System.out.println("API version is " + airavataClient.getAPIVersion());
 //            registerApplications(); // run this only the first time
-
+                for (int i = 0; i < 100; i++) {
 //            final String expId = createExperimentForSSHHost(airavata);
-                final String expId = createEchoExperimentForTrestles(airavataClient);
+                    final String expId = createEchoExperimentForTrestles(airavataClient);
 //            final String expId = createEchoExperimentForStampede(airavataClient);
 //            final String expId = createExperimentEchoForLocalHost(airavataClient);
 //            final String expId = createExperimentWRFTrestles(airavataClient);
@@ -75,13 +74,12 @@ public class CreateLaunchExperiment {
 
 //            System.out.println("Experiment ID : " + expId);
 //            updateExperiment(airavata, expId);
-            launchExperiment(airavataClient, expId);
-
-//              System.out.println(expId);
-        } catch (Exception e) {
-            logger.error("Error while connecting with server", e.getMessage());
-            e.printStackTrace();
-        }
+                    launchExperiment(airavataClient, expId);
+                }
+            } catch (Exception e) {
+                logger.error("Error while connecting with server", e.getMessage());
+                e.printStackTrace();
+            }
     }
 
     public static void registerApplications() {

http://git-wip-us.apache.org/repos/asf/airavata/blob/2bbeb7a9/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
index da98edb..5a14ac2 100644
--- a/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
+++ b/modules/gfac/gfac-monitor/src/main/java/org/apache/airavata/gfac/monitor/impl/pull/qstat/HPCPullMonitor.java
@@ -270,7 +270,8 @@ public class HPCPullMonitor extends PullMonitor {
             Set<String> keys = completedJobs.keySet();
             for (String jobName: keys) {
                 MonitorID completedJob = completedJobs.get(jobName);
-                GFacThreadPoolExecutor.getCachedThreadPool().submit(new OutHandlerWorker(gfac,
completedJob, publisher));
+                gfac.invokeOutFlowHandlers(completedJob.getJobExecutionContext());
+//                GFacThreadPoolExecutor.getCachedThreadPool().submit(new OutHandlerWorker(gfac,
completedJob, publisher));
                 CommonUtils.removeMonitorFromQueue(queue, completedJob);
                 if (zk == null) {
                     zk = completedJob.getJobExecutionContext().getZk();
@@ -343,8 +344,6 @@ public class HPCPullMonitor extends PullMonitor {
             }
             throw new AiravataMonitorException("Error retrieving the job status", e);
         }
-
-
         return true;
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/2bbeb7a9/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
index 6238c5c..2a82cfb 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/impl/GSISSHAbstractCluster.java
@@ -306,6 +306,12 @@ public class GSISSHAbstractCluster implements Cluster {
                      retry = 0;
                 } catch (SSHApiException e) {
                     retry--;
+                    try {
+                        Thread.sleep(5000);
+                    } catch (InterruptedException e1) {
+                        e1.printStackTrace();
+                    }
+                    reconnect(serverInfo, authenticationInfo);
                     reconnect(serverInfo,authenticationInfo);
                     if(retry==0) {
                         throw e;
@@ -387,6 +393,12 @@ public class GSISSHAbstractCluster implements Cluster {
                 }
             } catch (JSchException e) {
                 retry--;
+                try {
+                    Thread.sleep(5000);
+                } catch (InterruptedException e1) {
+                    e1.printStackTrace();
+                }
+                reconnect(serverInfo, authenticationInfo);
                 reconnect(serverInfo, authenticationInfo);
                 if (retry == 0) {
                     throw new SSHApiException("Failed during scping local file:" + localFile
+ " to remote file "
@@ -408,6 +420,11 @@ public class GSISSHAbstractCluster implements Cluster {
                 retry=0;
             } catch (IOException e) {
                 retry--;
+                try {
+                    Thread.sleep(5000);
+                } catch (InterruptedException e1) {
+                    e1.printStackTrace();
+                }
                 reconnect(serverInfo, authenticationInfo);
                 if (retry == 0) {
                     throw new SSHApiException("Failed during scping local file:" + localFile
+ " to remote file "
@@ -415,6 +432,11 @@ public class GSISSHAbstractCluster implements Cluster {
                 }
             } catch (JSchException e) {
                 retry--;
+                try {
+                    Thread.sleep(5000);
+                } catch (InterruptedException e1) {
+                    e1.printStackTrace();
+                }
                 reconnect(serverInfo, authenticationInfo);
                 if(retry==0) {
                     throw new SSHApiException("Failed during scping local file:" + localFile
+ " to remote file "
@@ -455,6 +477,11 @@ public class GSISSHAbstractCluster implements Cluster {
                         + serverInfo.getHost() + ":rFile", e);
             } catch (JSchException e) {
                 retry--;
+                try {
+                    Thread.sleep(5000);
+                } catch (InterruptedException e1) {
+                    e1.printStackTrace();
+                }
                 reconnect(serverInfo, authenticationInfo);
                 if (retry == 0) {
                     throw new SSHApiException("Failed during creating directory :" + directoryPath
+ " to remote file "
@@ -462,6 +489,11 @@ public class GSISSHAbstractCluster implements Cluster {
                 }
             } catch (SSHApiException e) {
                 retry--;
+                try {
+                    Thread.sleep(5000);
+                } catch (InterruptedException e1) {
+                    e1.printStackTrace();
+                }
                 reconnect(serverInfo, authenticationInfo);
                 if (retry == 0) {
                     throw new SSHApiException("Failed during creating directory :" + directoryPath
+ " to remote file "
@@ -484,6 +516,11 @@ public class GSISSHAbstractCluster implements Cluster {
                 retry=0;
             } catch (IOException e) {
                 retry--;
+                try {
+                    Thread.sleep(5000);
+                } catch (InterruptedException e1) {
+                    e1.printStackTrace();
+                }
                 reconnect(serverInfo, authenticationInfo);
                 if (retry == 0) {
                     throw new SSHApiException("Failed during creating directory:" + directoryPath
+ " to remote file "
@@ -498,6 +535,11 @@ public class GSISSHAbstractCluster implements Cluster {
                 }
             }catch (SSHApiException e) {
                 retry--;
+                try {
+                    Thread.sleep(5000);
+                } catch (InterruptedException e1) {
+                    e1.printStackTrace();
+                }
                 reconnect(serverInfo, authenticationInfo);
                 if (retry == 0) {
                     throw new SSHApiException("Failed during creating directory :" + directoryPath
+ " to remote file "
@@ -518,6 +560,11 @@ public class GSISSHAbstractCluster implements Cluster {
                 retry=0;
             } catch (SSHApiException e) {
                 retry--;
+                try {
+                    Thread.sleep(5000);
+                } catch (InterruptedException e1) {
+                    e1.printStackTrace();
+                }
                 reconnect(serverInfo, authenticationInfo);
                 if (retry == 0) {
                     throw new SSHApiException("Failed Getting statuses  to remote file",
e);


Mime
View raw message