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 2018/11/13 17:46:57 UTC

[airavata] branch staging updated: Setting an expiry time of 30 minutes for jobs and workflows

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

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


The following commit(s) were added to refs/heads/staging by this push:
     new 15a605e  Setting an expiry time of 30 minutes for jobs and workflows
15a605e is described below

commit 15a605e49e6bd83f9e6e46dad2a5ef03f4d8b24b
Author: Dimuthu Wannipurage <di...@datasprouts.com>
AuthorDate: Tue Nov 13 12:46:47 2018 -0500

    Setting an expiry time of 30 minutes for jobs and workflows
---
 .../main/java/org/apache/airavata/helix/workflow/WorkflowOperator.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/airavata-helix/workflow-impl/src/main/java/org/apache/airavata/helix/workflow/WorkflowOperator.java b/modules/airavata-helix/workflow-impl/src/main/java/org/apache/airavata/helix/workflow/WorkflowOperator.java
index e98d24c..3008bac 100644
--- a/modules/airavata-helix/workflow-impl/src/main/java/org/apache/airavata/helix/workflow/WorkflowOperator.java
+++ b/modules/airavata-helix/workflow-impl/src/main/java/org/apache/airavata/helix/workflow/WorkflowOperator.java
@@ -45,6 +45,7 @@ public class WorkflowOperator {
     private final static Logger logger = LoggerFactory.getLogger(WorkflowOperator.class);
 
     private static final String WORKFLOW_PREFIX = "Workflow_of_process_";
+    private static final long WORKFLOW_EXPIRY_TIME = 30 * 60 * 1000;
     private TaskDriver taskDriver;
 
     public WorkflowOperator(String helixClusterName, String instanceName, String zkConnectionString) throws Exception {
@@ -86,6 +87,7 @@ public class WorkflowOperator {
             JobConfig.Builder job = new JobConfig.Builder()
                     .addTaskConfigs(taskBuilds)
                     .setFailureThreshold(0)
+                    .setExpiry(WORKFLOW_EXPIRY_TIME)
                     .setMaxAttemptsPerTask(data.getRetryCount());
 
             if (!globalParticipant) {
@@ -104,6 +106,7 @@ public class WorkflowOperator {
 
         WorkflowConfig.Builder config = new WorkflowConfig.Builder().setFailureThreshold(0);
         workflowBuilder.setWorkflowConfig(config.build());
+        workflowBuilder.setExpiry(WORKFLOW_EXPIRY_TIME);
         Workflow workflow = workflowBuilder.build();
 
         taskDriver.start(workflow);