You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ch...@apache.org on 2015/03/13 19:36:02 UTC

airavata git commit: fixing AIRAVATA-1630

Repository: airavata
Updated Branches:
  refs/heads/master 757e8a3ab -> 990d72a1f


fixing AIRAVATA-1630


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

Branch: refs/heads/master
Commit: 990d72a1f007accea95d49a756cc5e10b20d924c
Parents: 757e8a3
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Fri Mar 13 14:35:57 2015 -0400
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Fri Mar 13 14:35:57 2015 -0400

----------------------------------------------------------------------
 .../org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java     | 7 +++++++
 .../java/org/apache/airavata/gfac/core/utils/GFacUtils.java   | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/990d72a1/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
index 420df6d..2ff0338 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/cpi/BetterGfacImpl.java
@@ -210,6 +210,7 @@ public class BetterGfacImpl implements GFac,Watcher {
             return submitJob(jobExecutionContext);
         } catch (Exception e) {
             log.error("Error inovoking the job with experiment ID: " + experimentID);
+            GFacUtils.saveErrorDetails(jobExecutionContext, e.getLocalizedMessage(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR );
             throw new GFacException(e);
         }
     }
@@ -495,10 +496,13 @@ public class BetterGfacImpl implements GFac,Watcher {
             }
             return true;
         } catch (ApplicationSettingsException e) {
+            GFacUtils.saveErrorDetails(jobExecutionContext, e.getLocalizedMessage(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR );
             throw new GFacException("Error launching the Job",e);
         } catch (KeeperException e) {
+            GFacUtils.saveErrorDetails(jobExecutionContext, e.getLocalizedMessage(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR );
             throw new GFacException("Error launching the Job",e);
         } catch (InterruptedException e) {
+            GFacUtils.saveErrorDetails(jobExecutionContext, e.getLocalizedMessage(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR );
             throw new GFacException("Error launching the Job",e);
         }
     }
@@ -509,6 +513,7 @@ public class BetterGfacImpl implements GFac,Watcher {
             jobExecutionContext = createJEC(experimentID, taskID, gatewayID);
             return cancel(jobExecutionContext);
         } catch (Exception e) {
+            GFacUtils.saveErrorDetails(jobExecutionContext, e.getLocalizedMessage(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR );
             log.error("Error inovoking the job with experiment ID: " + experimentID);
             throw new GFacException(e);
         }
@@ -660,6 +665,7 @@ public class BetterGfacImpl implements GFac,Watcher {
                         jobExecutionContext.getExperimentID(),
                         jobExecutionContext.getGatewayID());
 				monitorPublisher.publish(new JobStatusChangeEvent(JobState.FAILED, jobIdentity));
+                GFacUtils.saveErrorDetails(jobExecutionContext, e.getLocalizedMessage(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR );
 			} catch (NullPointerException e1) {
 				log.error("Error occured during updating the statuses of Experiments,tasks or Job statuses to failed, "
 						+ "NullPointerException occurred because at this point there might not have Job Created", e1, e);
@@ -671,6 +677,7 @@ public class BetterGfacImpl implements GFac,Watcher {
                         jobExecutionContext.getExperimentID(),
                         jobExecutionContext.getGatewayID());
 				monitorPublisher.publish(new TaskStatusChangeEvent(TaskState.FAILED, taskIdentity));
+                GFacUtils.saveErrorDetails(jobExecutionContext, e.getLocalizedMessage(), CorrectiveAction.CONTACT_SUPPORT, ErrorCategory.AIRAVATA_INTERNAL_ERROR );
 
 			}
 			jobExecutionContext.setProperty(ERROR_SENT, "true");

http://git-wip-us.apache.org/repos/asf/airavata/blob/990d72a1/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
index cbbce48..d30816e 100644
--- a/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
+++ b/modules/gfac/gfac-core/src/main/java/org/apache/airavata/gfac/core/utils/GFacUtils.java
@@ -792,7 +792,7 @@ public class GFacUtils {
 			CorrectiveAction action, ErrorCategory errorCatogory)
 			throws GFacException {
 		try {
-			Registry registry = RegistryFactory.getDefaultRegistry();
+			Registry registry = jobExecutionContext.getRegistry();
 			ErrorDetails details = new ErrorDetails();
 			details.setActualErrorMessage(errorMessage);
 			details.setCorrectiveAction(action);