airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject [05/35] airavata git commit: Add both stdout and stderr as failures reason for job
Date Sat, 23 Apr 2016 02:00:17 GMT
Add both stdout and stderr as failures reason for job


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

Branch: refs/heads/master
Commit: 7c30f789c59eaeb8b8a60615419f7964b722b695
Parents: 6c301e6
Author: Shameera Rathnayaka <shameerainfo@gmail.com>
Authored: Fri Apr 1 11:57:42 2016 -0400
Committer: Shameera Rathnayaka <shameerainfo@gmail.com>
Committed: Fri Apr 1 11:57:42 2016 -0400

----------------------------------------------------------------------
 .../apache/airavata/gfac/impl/HPCRemoteCluster.java    |  8 +++++++-
 .../gfac/impl/task/DefaultJobSubmissionTask.java       | 13 ++++++++-----
 2 files changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/7c30f789/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/HPCRemoteCluster.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/HPCRemoteCluster.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/HPCRemoteCluster.java
index 2e5c3a7..677ba9b 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/HPCRemoteCluster.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/HPCRemoteCluster.java
@@ -94,10 +94,16 @@ public class HPCRemoteCluster extends AbstractRemoteCluster{
 		if (jsoutput.getJobId() == null) {
 			if (outputParser.isJobSubmissionFailed(reader.getStdOutputString())) {
 				jsoutput.setJobSubmissionFailed(true);
-				jsoutput.setFailureReason(reader.getStdOutputString());
+				jsoutput.setFailureReason("stdout : " + reader.getStdOutputString() +
+						"\n stderr : " + reader.getStdErrorString());
 			}
 		}
 		jsoutput.setExitCode(reader.getExitCode());
+		if (jsoutput.getExitCode() != 0) {
+			jsoutput.setJobSubmissionFailed(true);
+			jsoutput.setFailureReason("stdout : " + reader.getStdOutputString() +
+					"\n stderr : " + reader.getStdErrorString());
+		}
 		jsoutput.setStdOut(reader.getStdOutputString());
 		jsoutput.setStdErr(reader.getStdErrorString());
 		return jsoutput;

http://git-wip-us.apache.org/repos/asf/airavata/blob/7c30f789/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DefaultJobSubmissionTask.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DefaultJobSubmissionTask.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DefaultJobSubmissionTask.java
index 975602f..a4be386 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DefaultJobSubmissionTask.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/DefaultJobSubmissionTask.java
@@ -103,27 +103,30 @@ public class DefaultJobSubmissionTask implements JobSubmissionTask {
 						GFacUtils.saveProcessError(processContext, errorModel);
 						GFacUtils.saveTaskError(taskContext, errorModel);
 						taskStatus.setState(TaskState.FAILED);
-						taskStatus.setReason("Job submission command exit with non zero exit code");
+						taskStatus.setReason("Job submission command didn't return a jobId");
 						taskStatus.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
 						taskContext.setTaskStatus(taskStatus);
 					} else {
 						String msg;
 						GFacUtils.saveJobModel(processContext, jobModel);
+						ErrorModel errorModel = new ErrorModel();
 						if (exitCode != Integer.MIN_VALUE) {
 							msg = "expId:" + processContext.getProcessModel().getExperimentId() + ", processId:"
+
 									processContext.getProcessId() + ", taskId: " + taskContext.getTaskId() +
 									" return non zero exit code:" + exitCode + "  for JobName:" + jobModel.getJobName()
+
-									", with failure reason :  " + jobSubmissionOutput.getStdOut() +  " Hence changing
job state to Failed." ;
+									", with failure reason : " + jobSubmissionOutput.getFailureReason()
+									+ " Hence changing job state to Failed." ;
+							errorModel.setActualErrorMessage(jobSubmissionOutput.getFailureReason());
 						} else {
 							msg = "expId:" + processContext.getProcessModel().getExperimentId() + ", processId:"
+
 									processContext.getProcessId() + ", taskId: " + taskContext.getTaskId() +
 									" doesn't  return valid job submission exit code for JobName:" + jobModel.getJobName()
+
-                                    ", with failure reason :  " + jobSubmissionOutput.getStdOut()
+  " Hence changing job state to Failed." ;
+									", with failure reason : stdout ->" + jobSubmissionOutput.getStdOut() +
+									" stderr -> " + jobSubmissionOutput.getStdErr() + " Hence changing job state
to Failed." ;
+							errorModel.setActualErrorMessage(msg);
 						}
 						log.error(msg);
-						ErrorModel errorModel = new ErrorModel();
 						errorModel.setUserFriendlyMessage(msg);
-						errorModel.setActualErrorMessage(msg);
 						GFacUtils.saveExperimentError(processContext, errorModel);
 						GFacUtils.saveProcessError(processContext, errorModel);
 						GFacUtils.saveTaskError(taskContext, errorModel);


Mime
View raw message