You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by di...@apache.org on 2020/04/22 03:18:31 UTC

[airavata] branch master updated: Avoiding the job resubmission due to helix bug

This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/master by this push:
     new 678be05  Avoiding the job resubmission due to helix bug
678be05 is described below

commit 678be056fa912b779269921b6e8406531292698c
Author: Dimuthu Wannipurage <di...@gmail.com>
AuthorDate: Tue Apr 21 23:17:58 2020 -0400

    Avoiding the job resubmission due to helix bug
---
 .../helix/impl/task/submission/DefaultJobSubmissionTask.java      | 8 +++++++-
 .../apache/airavata/helix/impl/workflow/PreWorkflowManager.java   | 1 -
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/DefaultJobSubmissionTask.java b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/DefaultJobSubmissionTask.java
index 7904a7b..30c22fb 100644
--- a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/DefaultJobSubmissionTask.java
+++ b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/task/submission/DefaultJobSubmissionTask.java
@@ -66,8 +66,14 @@ public class DefaultJobSubmissionTask extends JobSubmissionTask {
         }
 
         try {
-            saveAndPublishProcessStatus(ProcessState.EXECUTING);
+            List<JobModel> jobsOfTask = getTaskContext().getRegistryClient().getJobs("taskId", getTaskId());
+
+            if (jobsOfTask.size() > 0) {
+                logger.warn("A job is already available for task " + getTaskId());
+                return onSuccess("A job is already available for task " + getTaskId());
+            }
 
+            saveAndPublishProcessStatus(ProcessState.EXECUTING);
             GroovyMapData mapData = new GroovyMapBuilder(getTaskContext()).build();
 
             JobModel jobModel = new JobModel();
diff --git a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/workflow/PreWorkflowManager.java b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/workflow/PreWorkflowManager.java
index 49b516b..9423854 100644
--- a/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/workflow/PreWorkflowManager.java
+++ b/modules/airavata-helix/helix-spectator/src/main/java/org/apache/airavata/helix/impl/workflow/PreWorkflowManager.java
@@ -218,7 +218,6 @@ public class PreWorkflowManager extends WorkflowManager {
     public static void main(String[] args) throws Exception {
         PreWorkflowManager preWorkflowManager = new PreWorkflowManager();
         preWorkflowManager.startServer();
-        preWorkflowManager.createAndLaunchCancelWorkflow("PROCESS_7e19c779-e326-43d2-b025-aaa3a4b44c95","ultrascan");
     }
 
     private class ProcessLaunchMessageHandler implements MessageHandler {