airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lah...@apache.org
Subject git commit: fixing ArrayIndexOutOfBoundException during malformed qstat output
Date Thu, 18 Sep 2014 23:12:24 GMT
Repository: airavata
Updated Branches:
  refs/heads/master b8deb9e99 -> 450d249d6


fixing ArrayIndexOutOfBoundException during malformed qstat output


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

Branch: refs/heads/master
Commit: 450d249d6c7c8271d8f8ffce6b0b30bf317876aa
Parents: b8deb9e
Author: lahiru <lahiru@apache.org>
Authored: Thu Sep 18 19:12:18 2014 -0400
Committer: lahiru <lahiru@apache.org>
Committed: Thu Sep 18 19:12:18 2014 -0400

----------------------------------------------------------------------
 .../gfac/monitor/impl/pull/qstat/HPCPullMonitor.java      |  3 +--
 .../apache/airavata/gsi/ssh/api/job/PBSOutputParser.java  | 10 +++++++---
 .../airavata/gsi/ssh/api/job/SlurmOutputParser.java       |  7 +++++--
 3 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/450d249d/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 170030f..2275fb2 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
@@ -129,8 +129,7 @@ public class HPCPullMonitor extends PullMonitor {
                 // we catch all the exceptions here because no matter what happens we do
not stop running this
                 // thread, but ideally we should report proper error messages, but this is
handled in startPulling
                 // method, incase something happen in Thread.sleep we handle it with this
catch block.
-                e.printStackTrace();
-                logger.error(e.getMessage());
+                logger.error(e.getMessage(),e);
             }
         }
         // thread is going to return so we close all the connections

http://git-wip-us.apache.org/repos/asf/airavata/blob/450d249d/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSOutputParser.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSOutputParser.java
b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSOutputParser.java
index 8f1b51e..6d695b7 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSOutputParser.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/PBSOutputParser.java
@@ -176,13 +176,17 @@ public class PBSOutputParser implements OutputParser {
                         }
                     }
 //                    lastStop = i + 1;
-                    statusMap.put(jobID, JobStatus.valueOf(columnList.get(9)));
+                    try {
+                        statusMap.put(jobID, JobStatus.valueOf(columnList.get(9)));
+                    }catch(IndexOutOfBoundsException e){
+                        statusMap.put(jobID, JobStatus.valueOf("U"));
+                    }
                     found = true;
                     break;
                 }
             }
-            if(!found){
-                log.error("Couldn't find the status of the Job with JobName: " + jobName
+ "Job Id: " + jobID.split(",")[0]);
+            if(!found)
+            log.error("Couldn't find the status of the Job with JobName: " + jobName + "Job
Id: " + jobID.split(",")[0]);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/airavata/blob/450d249d/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SlurmOutputParser.java
----------------------------------------------------------------------
diff --git a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SlurmOutputParser.java
b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SlurmOutputParser.java
index c12441b..7a64871 100644
--- a/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SlurmOutputParser.java
+++ b/tools/gsissh/src/main/java/org/apache/airavata/gsi/ssh/api/job/SlurmOutputParser.java
@@ -173,8 +173,11 @@ public class SlurmOutputParser implements OutputParser {
                             columnList.add(s);
                         }
                     }
-//                    lastStop = i + 1;
-                    statusMap.put(jobID, JobStatus.valueOf(columnList.get(4)));
+                    try {
+                        statusMap.put(jobID, JobStatus.valueOf(columnList.get(4)));
+                    } catch (IndexOutOfBoundsException e) {
+                        statusMap.put(jobID, JobStatus.valueOf("U"));
+                    }
                     found = true;
                     break;
                 }


Mime
View raw message