airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shame...@apache.org
Subject airavata git commit: fixed AIRAVATA-2096
Date Mon, 12 Sep 2016 19:34:33 GMT
Repository: airavata
Updated Branches:
  refs/heads/hotfix-AIRAVATA-2096 [created] 2289aed1d


fixed AIRAVATA-2096


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

Branch: refs/heads/hotfix-AIRAVATA-2096
Commit: 2289aed1d9c9b12c2ee9d5019f3001a5b281d9fa
Parents: 05ea66e
Author: Shameera Rathnayaka <shameerainfo@gmail.com>
Authored: Mon Sep 12 15:34:23 2016 -0400
Committer: Shameera Rathnayaka <shameerainfo@gmail.com>
Committed: Mon Sep 12 15:34:23 2016 -0400

----------------------------------------------------------------------
 .../airavata/gfac/impl/GFacEngineImpl.java      | 26 +++++++++++++++++---
 .../airavata/gfac/server/GfacServerHandler.java |  1 +
 2 files changed, 23 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/2289aed1/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
index f64e521..1d1391c 100644
--- a/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
+++ b/modules/gfac/gfac-impl/src/main/java/org/apache/airavata/gfac/impl/GFacEngineImpl.java
@@ -89,8 +89,8 @@ public class GFacEngineImpl implements GFacEngine {
     @Override
     public ProcessContext populateProcessContext(String processId, String gatewayId, String
             tokenId) throws GFacException {
+        ProcessContext processContext = new ProcessContext(processId, gatewayId, tokenId);
         try {
-            ProcessContext processContext = new ProcessContext(processId, gatewayId, tokenId);
             AppCatalog appCatalog = Factory.getDefaultAppCatalog();
             processContext.setAppCatalog(appCatalog);
             ExperimentCatalog expCatalog = Factory.getDefaultExpCatalog();
@@ -206,12 +206,19 @@ public class GFacEngineImpl implements GFacEngine {
             }
             return processContext;
         } catch (AppCatalogException e) {
-            throw new GFacException("App catalog access exception ", e);
+            String msg = "App catalog access exception ";
+            updateProcessFailure(processContext, msg);
+            throw new GFacException(msg, e);
         } catch (RegistryException e) {
-            throw new GFacException("Registry access exception", e);
+            String msg = "Registry access exception";
+            updateProcessFailure(processContext, msg);
+            throw new GFacException(msg, e);
         } catch (AiravataException e) {
-            throw new GFacException("Remote cluster initialization error", e);
+            String msg = "Remote cluster initialization error";
+            updateProcessFailure(processContext, msg);
+            throw new GFacException(msg, e);
         }
+
     }
 
     private void checkRecoveryWithCancel(ProcessContext processContext) throws Exception
{
@@ -859,6 +866,17 @@ public class GFacEngineImpl implements GFacEngine {
         });
     }
 
+    private void updateProcessFailure(ProcessContext pc, String reason){
+        ProcessStatus status = new ProcessStatus(ProcessState.FAILED);
+        status.setReason(reason);
+        pc.setProcessStatus(status);
+        try {
+            GFacUtils.saveAndPublishProcessStatus(pc);
+        } catch (GFacException e) {
+            log.error("Error while save and publishing process failed status event");
+        }
+    }
+
     public static ResourceJobManager getResourceJobManager(ProcessContext processCtx) throws
AppCatalogException, GFacException {
         List<JobSubmissionInterface> jobSubmissionInterfaces = Factory.getDefaultAppCatalog().getComputeResource()
                 .getComputeResource(processCtx.getComputeResourceId()).getJobSubmissionInterfaces();

http://git-wip-us.apache.org/repos/asf/airavata/blob/2289aed1/modules/gfac/gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/gfac/gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
b/modules/gfac/gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
index c59e199..7366a19 100644
--- a/modules/gfac/gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
+++ b/modules/gfac/gfac-service/src/main/java/org/apache/airavata/gfac/server/GfacServerHandler.java
@@ -161,6 +161,7 @@ public class GfacServerHandler implements GfacService.Iface {
 	        executorService.execute(new GFacWorker(processId, gatewayId, tokenId));
         } catch (GFacException e) {
             log.error("Failed to submit process", e);
+
             return false;
         } catch (Exception e) {
 	        log.error("Error creating zookeeper nodes");


Mime
View raw message