airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject airavata git commit: fixing more issues with saving error details
Date Tue, 08 Sep 2015 20:55:47 GMT
Repository: airavata
Updated Branches:
  refs/heads/master b86393ee4 -> 4fa124229


fixing more issues with saving error details


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

Branch: refs/heads/master
Commit: 4fa124229e4361c819cba71dae163017155b702a
Parents: b86393e
Author: Chathuri Wimalasena <chathuri@apache.org>
Authored: Tue Sep 8 16:55:41 2015 -0400
Committer: Chathuri Wimalasena <chathuri@apache.org>
Committed: Tue Sep 8 16:55:41 2015 -0400

----------------------------------------------------------------------
 .../apache/airavata/gfac/core/GFacUtils.java    | 32 ++++++++++----------
 .../apache/airavata/gfac/impl/GFacWorker.java   |  2 ++
 .../gfac/impl/task/SSHJobSubmissionTask.java    |  7 ++++-
 .../experiment/catalog/resources/Utils.java     |  3 ++
 4 files changed, 27 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/4fa12422/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
index 57e64a2..49a6673 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/GFacUtils.java
@@ -337,22 +337,22 @@ public class GFacUtils {
 //		}
 //	}
 
-	public static void saveErrorDetails(
-			ProcessContext processContext, String errorMessage)
-			throws GFacException {
-		try {
-			ExperimentCatalog experimentCatalog = processContext.getExperimentCatalog();
-			ErrorModel details = new ErrorModel();
-			details.setActualErrorMessage(errorMessage);
-			details.setCreationTime(Calendar.getInstance().getTimeInMillis());
-			// FIXME : Save error model according to new data model
-//            experimentCatalog.add(ExpCatChildDataType.ERROR_DETAIL, details,
-//					jobExecutionContext.getTaskData().getTaskID());
-		} catch (Exception e) {
-			throw new GFacException("Error persisting job status"
-					+ e.getLocalizedMessage(), e);
-		}
-	}
+//	public static void saveErrorDetails(
+//			ProcessContext processContext, String errorMessage)
+//			throws GFacException {
+//		try {
+//			ExperimentCatalog experimentCatalog = processContext.getExperimentCatalog();
+//			ErrorModel details = new ErrorModel();
+//			details.setActualErrorMessage(errorMessage);
+//			details.setCreationTime(Calendar.getInstance().getTimeInMillis());
+//			// FIXME : Save error model according to new data model
+////            experimentCatalog.add(ExpCatChildDataType.ERROR_DETAIL, details,
+////					jobExecutionContext.getTaskData().getTaskID());
+//		} catch (Exception e) {
+//			throw new GFacException("Error persisting job status"
+//					+ e.getLocalizedMessage(), e);
+//		}
+//	}
 
     public static Map<String, Object> getInputParamMap(List<InputDataObjectType>
experimentData) throws GFacException {
         Map<String, Object> map = new HashMap<String, Object>();

http://git-wip-us.apache.org/repos/asf/airavata/blob/4fa12422/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacWorker.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacWorker.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacWorker.java
index fe33a86..d4ee892 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacWorker.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacWorker.java
@@ -22,6 +22,7 @@
 package org.apache.airavata.gfac.impl;
 
 import org.apache.airavata.common.exception.AiravataException;
+import org.apache.airavata.common.utils.AiravataUtils;
 import org.apache.airavata.gfac.core.GFacEngine;
 import org.apache.airavata.gfac.core.GFacException;
 import org.apache.airavata.gfac.core.GFacUtils;
@@ -131,6 +132,7 @@ public class GFacWorker implements Runnable {
             ErrorModel errorModel = new ErrorModel();
             errorModel.setUserFriendlyMessage("GFac Worker throws an exception");
             errorModel.setActualErrorMessage(errors.toString());
+            errorModel.setCreationTime(AiravataUtils.getCurrentTimestamp().getTime());
 			try {
 				GFacUtils.saveAndPublishProcessStatus(processContext);
                 GFacUtils.saveExperimentError(processContext, errorModel);

http://git-wip-us.apache.org/repos/asf/airavata/blob/4fa12422/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SSHJobSubmissionTask.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SSHJobSubmissionTask.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SSHJobSubmissionTask.java
index c285dad..84f2b86 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SSHJobSubmissionTask.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/task/SSHJobSubmissionTask.java
@@ -123,7 +123,12 @@ public class SSHJobSubmissionTask implements JobSubmissionTask {
 						    "remote jobId for JobName:" + jobModel.getJobName() + ", both submit and verify
steps " +
 						    "doesn't return a valid JobId. " + "Hence changing experiment state to Failed";
 				    log.error(msg);
-				    GFacUtils.saveErrorDetails(processContext, msg);
+                    ErrorModel errorModel = new ErrorModel();
+                    errorModel.setUserFriendlyMessage(msg);
+                    errorModel.setActualErrorMessage(msg);
+				    GFacUtils.saveExperimentError(processContext, errorModel);
+                    GFacUtils.saveProcessError(processContext, errorModel);
+                    GFacUtils.saveTaskError(taskContext, errorModel);
 				    taskStatus.setState(TaskState.FAILED);
 				    taskStatus.setReason("Couldn't find job id in both submitted and verified steps");
 			    }else {

http://git-wip-us.apache.org/repos/asf/airavata/blob/4fa12422/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
index d3c8e55..1fe5812 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/Utils.java
@@ -468,6 +468,7 @@ public class Utils {
         TaskErrorResource taskErrorResource = new TaskErrorResource();
         if (o != null){
             taskErrorResource.setTaskId(o.getTaskId());
+            taskErrorResource.setErrorId(o.getErrorId());
             taskErrorResource.setCreationTime(o.getCreationTime());
             taskErrorResource.setActualErrorMessage(o.getActualErrorMessage());
             taskErrorResource.setUserFriendlyMessage(o.getUserFriendlyMessage());
@@ -482,6 +483,7 @@ public class Utils {
         ExperimentErrorResource experimentErrorResource = new ExperimentErrorResource();
         if (o != null){
             experimentErrorResource.setExperimentId(o.getExperimentId());
+            experimentErrorResource.setErrorId(o.getErrorId());
             experimentErrorResource.setCreationTime(o.getCreationTime());
             experimentErrorResource.setActualErrorMessage(o.getActualErrorMessage());
             experimentErrorResource.setUserFriendlyMessage(o.getUserFriendlyMessage());
@@ -535,6 +537,7 @@ public class Utils {
         ProcessErrorResource processErrorResource = new ProcessErrorResource();
         if (o != null){
             processErrorResource.setProcessId(o.getProcessId());
+            processErrorResource.setErrorId(o.getErrorId());
             processErrorResource.setCreationTime(o.getCreationTime());
             processErrorResource.setActualErrorMessage(o.getActualErrorMessage());
             processErrorResource.setUserFriendlyMessage(o.getUserFriendlyMessage());


Mime
View raw message