airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject airavata git commit: Handle empty job id issue in SLURM Output parser.
Date Fri, 15 May 2015 15:26:13 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 55a9346a6 -> 769b905e1


Handle empty job id issue in SLURM Output parser.


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

Branch: refs/heads/master
Commit: 769b905e13ff8301f0334cd280839f8500e08edf
Parents: 55a9346
Author: shamrath <shameerainfo@gmail.com>
Authored: Fri May 15 11:26:10 2015 -0400
Committer: shamrath <shameerainfo@gmail.com>
Committed: Fri May 15 11:26:10 2015 -0400

----------------------------------------------------------------------
 .../apache/airavata/gfac/ssh/provider/impl/SSHProvider.java    | 6 +++---
 .../org/apache/airavata/gsi/ssh/api/job/SlurmOutputParser.java | 1 +
 2 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/769b905e/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java
b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java
index 23ddc90..805eee8 100644
--- a/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java
+++ b/modules/gfac/gfac-ssh/src/main/java/org/apache/airavata/gfac/ssh/provider/impl/SSHProvider.java
@@ -163,7 +163,7 @@ public class SSHProvider extends AbstractProvider {
                     log.info(jobDescriptor.toXML());
                     jobDetails.setJobDescription(jobDescriptor.toXML());
                     String jobID = cluster.submitBatchJob(jobDescriptor);
-                    if (jobID != null) {
+                    if (jobID != null && !jobID.isEmpty()) {
                         jobDetails.setJobID(jobID);
                         GFacUtils.saveJobStatus(jobExecutionContext, jobDetails, JobState.SUBMITTED,
monitorPublisher);
                         monitorPublisher.publish(new GfacExperimentStateChangeRequest(new
MonitorID(jobExecutionContext)
@@ -177,7 +177,7 @@ public class SSHProvider extends AbstractProvider {
                     } else {
                         jobExecutionContext.setJobDetails(jobDetails);
                         String verifyJobId = verifyJobSubmission(cluster, jobDetails);
-                        if (verifyJobId != null) {
+                        if (verifyJobId != null && !verifyJobId.isEmpty()) {
                             // JobStatus either changed from SUBMITTED to QUEUED or directly
to QUEUED
                             jobID = verifyJobId;
                             jobDetails.setJobID(jobID);
@@ -187,7 +187,7 @@ public class SSHProvider extends AbstractProvider {
                         }
                     }
 
-                    if (jobID == null) {
+                    if (jobID == null || jobID.isEmpty()) {
                         log.error("Couldn't find remote jobId for JobName:" + jobDetails.getJobName()
+ ", ExperimentId:" + jobExecutionContext.getExperimentID());
                         GFacUtils.updateExperimentStatus(jobExecutionContext.getExperimentID(),
ExperimentState.FAILED);
                         return;

http://git-wip-us.apache.org/repos/asf/airavata/blob/769b905e/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 1d6495b..b134366 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
@@ -97,6 +97,7 @@ public class SlurmOutputParser implements OutputParser {
      * @return
      */
     public String parseJobSubmission(String rawOutput) throws SSHApiException {
+        // FIXME : use regex to match correct jobId;
         log.info(rawOutput);
         String[] info = rawOutput.split("\n");
         for (String anInfo : info) {


Mime
View raw message