airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chath...@apache.org
Subject airavata git commit: adding possible fix to same update time
Date Fri, 08 Jan 2016 15:26:33 GMT
Repository: airavata
Updated Branches:
  refs/heads/master 6d338d07f -> 545e75344


adding possible fix to same update time


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

Branch: refs/heads/master
Commit: 545e7534483d271baf999df52e8cdf2b5a12ec45
Parents: 6d338d0
Author: Chathuri Wimalasena <chathuri@apache.org>
Authored: Fri Jan 8 10:27:15 2016 -0500
Committer: Chathuri Wimalasena <chathuri@apache.org>
Committed: Fri Jan 8 10:27:15 2016 -0500

----------------------------------------------------------------------
 .../server/OrchestratorServerHandler.java       | 28 +++++++++++++++-----
 1 file changed, 21 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/545e7534/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
index 2cda709..66861dd 100644
--- a/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
+++ b/modules/orchestrator/orchestrator-service/src/main/java/org/apache/airavata/orchestrator/server/OrchestratorServerHandler.java
@@ -177,6 +177,11 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface
{
             if (executionType == ExperimentType.SINGLE_APPLICATION) {
                 //its an single application execution experiment
                 log.debug(experimentId, "Launching single application experiment {}.", experimentId);
+                ExperimentStatus status = new ExperimentStatus(ExperimentState.LAUNCHED);
+                status.setReason("submitted all processes");
+                status.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
+                OrchestratorUtils.updageExperimentStatus(experimentId, status);
+                log.info("expId: {}, Launched experiment ", experimentId);
 	            ExperimentStatusChangeEvent event = new ExperimentStatusChangeEvent(ExperimentState.LAUNCHED,
 			            experimentId,
 			            gatewayId);
@@ -402,28 +407,37 @@ public class OrchestratorServerHandler implements OrchestratorService.Iface
{
             try {
                 launchSingleAppExperiment();
             } catch (TException e) {
-                e.printStackTrace();
+                log.error("Unable to launch experiment..", e);
+            } catch (AiravataException e) {
+                log.error("Unable to publish experiment status..", e);
             }
         }
 
-        private boolean launchSingleAppExperiment() throws TException {
+        private boolean launchSingleAppExperiment() throws TException, AiravataException
{
             try {
                 List<String> processIds = experimentCatalog.getIds(ExperimentCatalogModelType.PROCESS,
 						AbstractExpCatResource.ProcessConstants.EXPERIMENT_ID, experimentId);
                 for (String processId : processIds) {
                     launchProcess(processId, airavataCredStoreToken, gatewayId);
                 }
-				ExperimentStatus status = new ExperimentStatus(ExperimentState.LAUNCHED);
-				status.setReason("submitted all processes");
-				status.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
-				OrchestratorUtils.updageExperimentStatus(experimentId, status);
-				log.info("expId: {}, Launched experiment ", experimentId);
+//				ExperimentStatus status = new ExperimentStatus(ExperimentState.LAUNCHED);
+//				status.setReason("submitted all processes");
+//				status.setTimeOfStateChange(AiravataUtils.getCurrentTimestamp().getTime());
+//				OrchestratorUtils.updageExperimentStatus(experimentId, status);
+//				log.info("expId: {}, Launched experiment ", experimentId);
 			} catch (Exception e) {
 	            ExperimentStatus status = new ExperimentStatus(ExperimentState.FAILED);
 	            status.setReason("Error while updating task status");
 	            OrchestratorUtils.updageExperimentStatus(experimentId, status);
 	            log.error("expId: " + experimentId + ", Error while updating task status, hence
updated experiment status to " +
 			            ExperimentState.FAILED, e);
+                ExperimentStatusChangeEvent event = new ExperimentStatusChangeEvent(ExperimentState.FAILED,
+                        experimentId,
+                        gatewayId);
+                String messageId = AiravataUtils.getId("EXPERIMENT");
+                MessageContext messageContext = new MessageContext(event, MessageType.EXPERIMENT,
messageId, gatewayId);
+                messageContext.setUpdatedTime(AiravataUtils.getCurrentTimestamp());
+                publisher.publish(messageContext);
 	            throw new TException(e);
             }
             return true;


Mime
View raw message