[GitHub] [helix] alirezazamani commented on a change in pull request #410: Fix the execution delay for the jobs (409)

2019-08-19 Thread GitBox
alirezazamani commented on a change in pull request #410: Fix the execution 
delay for the jobs (409)
URL: https://github.com/apache/helix/pull/410#discussion_r315308557
 
 

 ##
 File path: 
helix-core/src/test/java/org/apache/helix/integration/task/TestExecutionDelay.java
 ##
 @@ -0,0 +1,124 @@
+package org.apache.helix.integration.task;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Lists;
+import java.util.List;
+import org.apache.helix.HelixAdmin;
+import org.apache.helix.HelixDataAccessor;
+import org.apache.helix.HelixException;
+import org.apache.helix.PropertyKey;
+import org.apache.helix.PropertyPathBuilder;
+import org.apache.helix.TestHelper;
+import org.apache.helix.task.JobConfig;
+import org.apache.helix.task.JobContext;
+import org.apache.helix.task.JobQueue;
+import org.apache.helix.task.TaskConstants;
+import org.apache.helix.task.TaskState;
+import org.apache.helix.task.TaskUtil;
+import org.apache.helix.task.Workflow;
+import org.apache.helix.task.WorkflowContext;
+import 
org.apache.helix.tools.ClusterVerifiers.BestPossibleExternalViewVerifier;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+/**
+ * Test To check if the Execution Delay is respected.
+ */
+public class TestExecutionDelay extends TaskTestBase {
+
+  @BeforeClass
+  public void beforeClass() throws Exception {
+super.beforeClass();
+  }
+
+  @Test
+  public void testExecutionDelay() throws Exception {
+// Execution Delay is set to be a large number. Hence, the workflow should 
not be completed
+// soon.
+final long executionDelay = 1000L;
+String workflowName = TestHelper.getTestMethodName();
+Workflow.Builder builder = new Workflow.Builder(workflowName);
+
+// Workflow DAG Schematic:
+//  JOB0
+//   /\
+//  /  \
+// /\
+//   JOB1   JOB2
+
+JobConfig.Builder jobBuilder = 
JobConfig.Builder.fromMap(WorkflowGenerator.DEFAULT_JOB_CONFIG)
+.setMaxAttemptsPerTask(1).setWorkflow(workflowName)
+.setJobCommandConfigMap(ImmutableMap.of(MockTask.JOB_DELAY, "1000"));
+
+JobConfig.Builder jobBuilder2 = 
JobConfig.Builder.fromMap(WorkflowGenerator.DEFAULT_JOB_CONFIG)
+.setMaxAttemptsPerTask(1).setWorkflow(workflowName)
+.setJobCommandConfigMap(ImmutableMap.of(MockTask.JOB_DELAY, "1000"));
+
+JobConfig.Builder jobBuilder3 = 
JobConfig.Builder.fromMap(WorkflowGenerator.DEFAULT_JOB_CONFIG)
+.setMaxAttemptsPerTask(1).setWorkflow(workflowName)
+.setJobCommandConfigMap(ImmutableMap.of(MockTask.JOB_DELAY, "1000"));
+
+builder.addParentChildDependency("JOB0", "JOB1");
+builder.addParentChildDependency("JOB0", "JOB2");
+builder.addJob("JOB0", jobBuilder.setExecutionDelay(executionDelay));
+builder.addJob("JOB1", jobBuilder2);
+builder.addJob("JOB2", jobBuilder3);
+
+// Since the execution delay is set as a long time, it is expected to 
reach time out.
+// If the workflow completed without any exception, it means that 
ExecutionDelay has not been
+// respected.
+_driver.start(builder.build());
+
+// Verify workflow Context is created.
+// Wait until Workflow Context is created.
+boolean resultWorkflow = TestHelper.verify(() -> {
+  WorkflowContext wCtx1 = _driver.getWorkflowContext(workflowName);
+  return (wCtx1 != null);
+}, 60 * 1000);
+Assert.assertTrue(resultWorkflow);
+
+// Verify StartTime is set for the Job.
+// Wait until startTime is set.
+boolean resultStartTime = TestHelper.verify(() -> {
+  WorkflowContext wCtx1 = _driver.getWorkflowContext(workflowName);
+  long startTime = -1;
+  try {
+startTime = 
wCtx1.getJobStartTime(TaskUtil.getNamespacedJobName(workflowName, "JOB0"));
+  } catch (Exception e) {
+// pass
+  }
+  return (startTime != -1);
+}, 60 * 1000);
+Assert.assertTrue(resultStartTime);
+
+// Verify Job Context is not created. If Job Context is created, it means 
that the execution
+// delay is not respected. if 

[GitHub] [helix] alirezazamani commented on a change in pull request #410: Fix the execution delay for the jobs (409)

2019-08-19 Thread GitBox
alirezazamani commented on a change in pull request #410: Fix the execution 
delay for the jobs (409)
URL: https://github.com/apache/helix/pull/410#discussion_r315303268
 
 

 ##
 File path: 
helix-core/src/test/java/org/apache/helix/integration/task/TestExecutionDelay.java
 ##
 @@ -0,0 +1,124 @@
+package org.apache.helix.integration.task;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Lists;
+import java.util.List;
+import org.apache.helix.HelixAdmin;
+import org.apache.helix.HelixDataAccessor;
+import org.apache.helix.HelixException;
+import org.apache.helix.PropertyKey;
+import org.apache.helix.PropertyPathBuilder;
+import org.apache.helix.TestHelper;
+import org.apache.helix.task.JobConfig;
+import org.apache.helix.task.JobContext;
+import org.apache.helix.task.JobQueue;
+import org.apache.helix.task.TaskConstants;
+import org.apache.helix.task.TaskState;
+import org.apache.helix.task.TaskUtil;
+import org.apache.helix.task.Workflow;
+import org.apache.helix.task.WorkflowContext;
+import 
org.apache.helix.tools.ClusterVerifiers.BestPossibleExternalViewVerifier;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+/**
+ * Test To check if the Execution Delay is respected.
+ */
+public class TestExecutionDelay extends TaskTestBase {
+
+  @BeforeClass
+  public void beforeClass() throws Exception {
+super.beforeClass();
+  }
+
+  @Test
+  public void testExecutionDelay() throws Exception {
+// Execution Delay is set to be a large number. Hence, the workflow should 
not be completed
+// soon.
+final long executionDelay = 1000L;
+String workflowName = TestHelper.getTestMethodName();
+Workflow.Builder builder = new Workflow.Builder(workflowName);
+
+// Workflow DAG Schematic:
+//  JOB0
+//   /\
+//  /  \
+// /\
+//   JOB1   JOB2
+
+JobConfig.Builder jobBuilder = 
JobConfig.Builder.fromMap(WorkflowGenerator.DEFAULT_JOB_CONFIG)
+.setMaxAttemptsPerTask(1).setWorkflow(workflowName)
+.setJobCommandConfigMap(ImmutableMap.of(MockTask.JOB_DELAY, "1000"));
+
+JobConfig.Builder jobBuilder2 = 
JobConfig.Builder.fromMap(WorkflowGenerator.DEFAULT_JOB_CONFIG)
+.setMaxAttemptsPerTask(1).setWorkflow(workflowName)
+.setJobCommandConfigMap(ImmutableMap.of(MockTask.JOB_DELAY, "1000"));
+
+JobConfig.Builder jobBuilder3 = 
JobConfig.Builder.fromMap(WorkflowGenerator.DEFAULT_JOB_CONFIG)
+.setMaxAttemptsPerTask(1).setWorkflow(workflowName)
+.setJobCommandConfigMap(ImmutableMap.of(MockTask.JOB_DELAY, "1000"));
+
+builder.addParentChildDependency("JOB0", "JOB1");
+builder.addParentChildDependency("JOB0", "JOB2");
+builder.addJob("JOB0", jobBuilder.setExecutionDelay(executionDelay));
+builder.addJob("JOB1", jobBuilder2);
+builder.addJob("JOB2", jobBuilder3);
+
+// Since the execution delay is set as a long time, it is expected to 
reach time out.
+// If the workflow completed without any exception, it means that 
ExecutionDelay has not been
+// respected.
+_driver.start(builder.build());
+
+// Verify workflow Context is created.
+// Wait until Workflow Context is created.
+boolean resultWorkflow = TestHelper.verify(() -> {
+  WorkflowContext wCtx1 = _driver.getWorkflowContext(workflowName);
+  return (wCtx1 != null);
+}, 60 * 1000);
+Assert.assertTrue(resultWorkflow);
+
+// Verify StartTime is set for the Job.
+// Wait until startTime is set.
+boolean resultStartTime = TestHelper.verify(() -> {
+  WorkflowContext wCtx1 = _driver.getWorkflowContext(workflowName);
+  long startTime = -1;
+  try {
+startTime = 
wCtx1.getJobStartTime(TaskUtil.getNamespacedJobName(workflowName, "JOB0"));
+  } catch (Exception e) {
+// pass
+  }
+  return (startTime != -1);
+}, 60 * 1000);
+Assert.assertTrue(resultStartTime);
+
+// Verify Job Context is not created. If Job Context is created, it means 
that the execution
+// delay is not respected. if 

[GitHub] [helix] alirezazamani commented on a change in pull request #410: Fix the execution delay for the jobs (409)

2019-08-19 Thread GitBox
alirezazamani commented on a change in pull request #410: Fix the execution 
delay for the jobs (409)
URL: https://github.com/apache/helix/pull/410#discussion_r315289200
 
 

 ##
 File path: 
helix-core/src/main/java/org/apache/helix/task/WorkflowDispatcher.java
 ##
 @@ -602,4 +590,33 @@ private void removeContextsAndPreviousAssignment(String 
workflow, Set jo
 }
 cache.removeContext(workflow);
   }
+
+  private long computeStartTimeForJob(WorkflowContext workflowCtx, String job,
+  JobConfig jobConfig) {
+// Since the start time is calculated base on the time of completion of 
parent jobs for this
+// job, the calculated start time should only be calculated once. Persist 
the calculated time
+// in WorkflowContext znode.
+long calculatedStartTime = workflowCtx.getJobStartTime(job);
+if (calculatedStartTime < 0) {
+  // Calculate the start time if it is not already calculated
+  calculatedStartTime = System.currentTimeMillis();
+  // If the start time is not calculated before, do the math.
+  if (jobConfig.getExecutionDelay() >= 0) {
+calculatedStartTime += jobConfig.getExecutionDelay();
+  }
+  calculatedStartTime = Math.max(calculatedStartTime, 
jobConfig.getExecutionStart());
+  workflowCtx.setJobStartTime(job, calculatedStartTime);
+}
+return calculatedStartTime;
+  }
+
+  private boolean isJobReadyToExecute(WorkflowContext workflowCtx, String job) 
{
+long calculatedStartTime = workflowCtx.getJobStartTime(job);
+long timeNow = System.currentTimeMillis();
+if (timeNow < calculatedStartTime) {
 
 Review comment:
   There is no other checks it needed. I agree. I moved it inline to the caller 
function.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org
For additional commands, e-mail: reviews-h...@helix.apache.org



[GitHub] [helix] alirezazamani commented on a change in pull request #410: Fix the execution delay for the jobs (409)

2019-08-15 Thread GitBox
alirezazamani commented on a change in pull request #410: Fix the execution 
delay for the jobs (409)
URL: https://github.com/apache/helix/pull/410#discussion_r314388288
 
 

 ##
 File path: 
helix-core/src/test/java/org/apache/helix/integration/task/TestExecutionDelay.java
 ##
 @@ -0,0 +1,79 @@
+package org.apache.helix.integration.task;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import com.google.common.collect.ImmutableMap;
+import org.apache.helix.HelixAdmin;
+import org.apache.helix.HelixDataAccessor;
+import org.apache.helix.HelixException;
+import org.apache.helix.PropertyKey;
+import org.apache.helix.TestHelper;
+import org.apache.helix.task.JobConfig;
+import org.apache.helix.task.JobQueue;
+import org.apache.helix.task.TaskState;
+import org.apache.helix.task.TaskUtil;
+import org.apache.helix.task.Workflow;
+import org.apache.helix.task.WorkflowContext;
+import 
org.apache.helix.tools.ClusterVerifiers.BestPossibleExternalViewVerifier;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+public class TestExecutionDelay extends TaskTestBase {
+  private HelixAdmin admin;
 
 Review comment:
   Not used. I deleted it in new commit.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org
For additional commands, e-mail: reviews-h...@helix.apache.org



[GitHub] [helix] alirezazamani commented on a change in pull request #410: Fix the execution delay for the jobs (409)

2019-08-15 Thread GitBox
alirezazamani commented on a change in pull request #410: Fix the execution 
delay for the jobs (409)
URL: https://github.com/apache/helix/pull/410#discussion_r314388288
 
 

 ##
 File path: 
helix-core/src/test/java/org/apache/helix/integration/task/TestExecutionDelay.java
 ##
 @@ -0,0 +1,79 @@
+package org.apache.helix.integration.task;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import com.google.common.collect.ImmutableMap;
+import org.apache.helix.HelixAdmin;
+import org.apache.helix.HelixDataAccessor;
+import org.apache.helix.HelixException;
+import org.apache.helix.PropertyKey;
+import org.apache.helix.TestHelper;
+import org.apache.helix.task.JobConfig;
+import org.apache.helix.task.JobQueue;
+import org.apache.helix.task.TaskState;
+import org.apache.helix.task.TaskUtil;
+import org.apache.helix.task.Workflow;
+import org.apache.helix.task.WorkflowContext;
+import 
org.apache.helix.tools.ClusterVerifiers.BestPossibleExternalViewVerifier;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+public class TestExecutionDelay extends TaskTestBase {
+  private HelixAdmin admin;
 
 Review comment:
   Not used. I deleted it.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org
For additional commands, e-mail: reviews-h...@helix.apache.org



[GitHub] [helix] alirezazamani commented on a change in pull request #410: Fix the execution delay for the jobs (409)

2019-08-15 Thread GitBox
alirezazamani commented on a change in pull request #410: Fix the execution 
delay for the jobs (409)
URL: https://github.com/apache/helix/pull/410#discussion_r314387956
 
 

 ##
 File path: 
helix-core/src/test/java/org/apache/helix/integration/task/TestExecutionDelay.java
 ##
 @@ -0,0 +1,79 @@
+package org.apache.helix.integration.task;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import com.google.common.collect.ImmutableMap;
+import org.apache.helix.HelixAdmin;
+import org.apache.helix.HelixDataAccessor;
+import org.apache.helix.HelixException;
+import org.apache.helix.PropertyKey;
+import org.apache.helix.TestHelper;
+import org.apache.helix.task.JobConfig;
+import org.apache.helix.task.JobQueue;
+import org.apache.helix.task.TaskState;
+import org.apache.helix.task.TaskUtil;
+import org.apache.helix.task.Workflow;
+import org.apache.helix.task.WorkflowContext;
+import 
org.apache.helix.tools.ClusterVerifiers.BestPossibleExternalViewVerifier;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+public class TestExecutionDelay extends TaskTestBase {
+  private HelixAdmin admin;
+
+  @BeforeClass public void beforeClass() throws Exception {
+admin = _gSetupTool.getClusterManagementTool();
+super.beforeClass();
+  }
+
+  @Test(expectedExceptions = HelixException.class) public void 
testExecutionDelay()
 
 Review comment:
   Fixed.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org
For additional commands, e-mail: reviews-h...@helix.apache.org



[GitHub] [helix] alirezazamani commented on a change in pull request #410: Fix the execution delay for the jobs (409)

2019-08-15 Thread GitBox
alirezazamani commented on a change in pull request #410: Fix the execution 
delay for the jobs (409)
URL: https://github.com/apache/helix/pull/410#discussion_r314386144
 
 

 ##
 File path: 
helix-core/src/test/java/org/apache/helix/integration/task/TestExecutionDelay.java
 ##
 @@ -0,0 +1,79 @@
+package org.apache.helix.integration.task;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import com.google.common.collect.ImmutableMap;
+import org.apache.helix.HelixAdmin;
+import org.apache.helix.HelixDataAccessor;
+import org.apache.helix.HelixException;
+import org.apache.helix.PropertyKey;
+import org.apache.helix.TestHelper;
+import org.apache.helix.task.JobConfig;
+import org.apache.helix.task.JobQueue;
+import org.apache.helix.task.TaskState;
+import org.apache.helix.task.TaskUtil;
+import org.apache.helix.task.Workflow;
+import org.apache.helix.task.WorkflowContext;
+import 
org.apache.helix.tools.ClusterVerifiers.BestPossibleExternalViewVerifier;
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+public class TestExecutionDelay extends TaskTestBase {
+  private HelixAdmin admin;
+
+  @BeforeClass public void beforeClass() throws Exception {
+admin = _gSetupTool.getClusterManagementTool();
+super.beforeClass();
 
 Review comment:
   I fixed that. Thanks.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org
For additional commands, e-mail: reviews-h...@helix.apache.org



[GitHub] [helix] alirezazamani commented on a change in pull request #410: Fix the execution delay for the jobs (409)

2019-08-15 Thread GitBox
alirezazamani commented on a change in pull request #410: Fix the execution 
delay for the jobs (409)
URL: https://github.com/apache/helix/pull/410#discussion_r31438
 
 

 ##
 File path: 
helix-core/src/main/java/org/apache/helix/task/WorkflowDispatcher.java
 ##
 @@ -165,7 +165,9 @@ public void updateWorkflowStatus(String workflow, 
WorkflowConfig workflowCfg,
 RuntimeJobDag runtimeJobDag = 
_clusterDataCache.getTaskDataCache().getRuntimeJobDag(workflow);
 if (runtimeJobDag != null) {
   for (String inflightJob : runtimeJobDag.getInflightJobList()) {
-processJob(inflightJob, currentStateOutput, bestPossibleOutput, 
workflowCtx);
+if (System.currentTimeMillis() >= 
workflowCtx.getJobStartTime(inflightJob)) {
 
 Review comment:
   Thank you for your comments.
   1- Based on same logic that is added few lines below (which calculates the 
start time and store these information and process the job if possible), this 
is the place that this check should happen. (same as the scheduleJobs method in 
WorkflowDistpatcher).
   2- About the comprehensive change, I agree with you. This is just a quick 
fix. We will need to revisit several concepts such as inflight jobs and retry 
delay. I am working on the retry delay and will create new issue for that as 
well. After that we can think on a comprehensive changes to the Task Framework.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org
For additional commands, e-mail: reviews-h...@helix.apache.org



[GitHub] [helix] alirezazamani commented on a change in pull request #410: Fix the execution delay for the jobs (409)

2019-08-15 Thread GitBox
alirezazamani commented on a change in pull request #410: Fix the execution 
delay for the jobs (409)
URL: https://github.com/apache/helix/pull/410#discussion_r31438
 
 

 ##
 File path: 
helix-core/src/main/java/org/apache/helix/task/WorkflowDispatcher.java
 ##
 @@ -165,7 +165,9 @@ public void updateWorkflowStatus(String workflow, 
WorkflowConfig workflowCfg,
 RuntimeJobDag runtimeJobDag = 
_clusterDataCache.getTaskDataCache().getRuntimeJobDag(workflow);
 if (runtimeJobDag != null) {
   for (String inflightJob : runtimeJobDag.getInflightJobList()) {
-processJob(inflightJob, currentStateOutput, bestPossibleOutput, 
workflowCtx);
+if (System.currentTimeMillis() >= 
workflowCtx.getJobStartTime(inflightJob)) {
 
 Review comment:
   Thank you for your comments.
   1- Based on same logic that is added few line below (which calculates the 
start time and store these information and process the job if possible), this 
is the place that this check should happen. (same as the scheduleJobs method in 
WorkflowDistpatcher).
   2- About the comprehensive change, I agree with you. This is just a quick 
fix. We will need to revisit several concepts such as inflight jobs and retry 
delay. I am working on the retry delay and will create new issue for that as 
well. After that we can think on a comprehensive changes to the Task Framework.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org
For additional commands, e-mail: reviews-h...@helix.apache.org