From 1490896f966f5310692fd770c24901e85cc49417 Mon Sep 17 00:00:00 2001 From: Surafel Korse Date: Fri, 7 Oct 2022 18:46:46 -0400 Subject: [PATCH 1/2] Set scheduledTime and startTime for all system tasks --- .../conductor/cassandra/dao/CassandraExecutionDAO.java | 4 +++- .../conductor/core/execution/mapper/DecisionTaskMapper.java | 4 +++- .../conductor/core/execution/mapper/DoWhileTaskMapper.java | 4 +++- .../core/execution/mapper/ExclusiveJoinTaskMapper.java | 4 +++- .../core/execution/mapper/ForkJoinDynamicTaskMapper.java | 6 ++++-- .../conductor/core/execution/mapper/ForkJoinTaskMapper.java | 1 + .../conductor/core/execution/mapper/HumanTaskMapper.java | 4 +++- .../conductor/core/execution/mapper/InlineTaskMapper.java | 4 +++- .../conductor/core/execution/mapper/JoinTaskMapper.java | 4 +++- .../core/execution/mapper/JsonJQTransformTaskMapper.java | 4 +++- .../conductor/core/execution/mapper/LambdaTaskMapper.java | 4 +++- .../core/execution/mapper/SetVariableTaskMapper.java | 4 +++- .../conductor/core/execution/mapper/SwitchTaskMapper.java | 4 +++- .../core/execution/mapper/TerminateTaskMapper.java | 4 +++- .../conductor/core/execution/mapper/WaitTaskMapper.java | 4 +++- 15 files changed, 44 insertions(+), 15 deletions(-) diff --git a/cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraExecutionDAO.java b/cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraExecutionDAO.java index 50bf1a3705..ce564af0ab 100644 --- a/cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraExecutionDAO.java +++ b/cassandra-persistence/src/main/java/com/netflix/conductor/cassandra/dao/CassandraExecutionDAO.java @@ -192,7 +192,9 @@ public List createTasks(List tasks) { // update the task_lookup table tasks.forEach( task -> { - task.setScheduledTime(System.currentTimeMillis()); + if (task.getScheduledTime() == 0) { + task.setScheduledTime(System.currentTimeMillis()); + } session.execute( updateTaskLookupStatement.bind( workflowUUID, toUUID(task.getTaskId(), "Invalid task id"))); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/DecisionTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/DecisionTaskMapper.java index 45b2add899..9c60087112 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/DecisionTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/DecisionTaskMapper.java @@ -88,7 +88,9 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { decisionTask.setTaskDefName(TaskType.TASK_TYPE_DECISION); decisionTask.addInput("case", caseValue); decisionTask.addOutput("caseOutput", Collections.singletonList(caseValue)); - decisionTask.setStartTime(System.currentTimeMillis()); + final long currentTimeMillis = System.currentTimeMillis(); + decisionTask.setScheduledTime(currentTimeMillis); + decisionTask.setStartTime(currentTimeMillis); decisionTask.setStatus(TaskModel.Status.IN_PROGRESS); tasksToBeScheduled.add(decisionTask); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/DoWhileTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/DoWhileTaskMapper.java index 1a0c504bea..c81ec00b64 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/DoWhileTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/DoWhileTaskMapper.java @@ -87,7 +87,9 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { TaskModel doWhileTask = taskMapperContext.createTaskModel(); doWhileTask.setTaskType(TaskType.TASK_TYPE_DO_WHILE); doWhileTask.setStatus(TaskModel.Status.IN_PROGRESS); - doWhileTask.setStartTime(System.currentTimeMillis()); + final long currentTimeMillis = System.currentTimeMillis(); + doWhileTask.setScheduledTime(currentTimeMillis); + doWhileTask.setStartTime(currentTimeMillis); doWhileTask.setRateLimitPerFrequency(taskDefinition.getRateLimitPerFrequency()); doWhileTask.setRateLimitFrequencyInSeconds(taskDefinition.getRateLimitFrequencyInSeconds()); doWhileTask.setRetryCount(taskMapperContext.getRetryCount()); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/ExclusiveJoinTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/ExclusiveJoinTaskMapper.java index 5fdb86ea2e..a11779411a 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/ExclusiveJoinTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/ExclusiveJoinTaskMapper.java @@ -51,7 +51,9 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { TaskModel joinTask = taskMapperContext.createTaskModel(); joinTask.setTaskType(TaskType.TASK_TYPE_EXCLUSIVE_JOIN); joinTask.setTaskDefName(TaskType.TASK_TYPE_EXCLUSIVE_JOIN); - joinTask.setStartTime(System.currentTimeMillis()); + final long currentTimeMillis = System.currentTimeMillis(); + joinTask.setScheduledTime(currentTimeMillis); + joinTask.setStartTime(currentTimeMillis); joinTask.setInputData(joinInput); joinTask.setStatus(TaskModel.Status.IN_PROGRESS); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinDynamicTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinDynamicTaskMapper.java index 905424b0c2..3b1e55c526 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinDynamicTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinDynamicTaskMapper.java @@ -251,8 +251,10 @@ TaskModel createDynamicForkTask( TaskModel forkDynamicTask = taskMapperContext.createTaskModel(); forkDynamicTask.setTaskType(TaskType.TASK_TYPE_FORK); forkDynamicTask.setTaskDefName(TaskType.TASK_TYPE_FORK); - forkDynamicTask.setStartTime(System.currentTimeMillis()); - forkDynamicTask.setEndTime(System.currentTimeMillis()); + final long currentTimeMillis = System.currentTimeMillis(); + forkDynamicTask.setScheduledTime(currentTimeMillis); + forkDynamicTask.setStartTime(currentTimeMillis); + forkDynamicTask.setEndTime(currentTimeMillis); List forkedTaskNames = dynForkTasks.stream() .map(WorkflowTask::getTaskReferenceName) diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinTaskMapper.java index c90b5a6f44..e4b79f8f6d 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinTaskMapper.java @@ -74,6 +74,7 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) forkTask.setTaskType(TaskType.TASK_TYPE_FORK); forkTask.setTaskDefName(TaskType.TASK_TYPE_FORK); long epochMillis = System.currentTimeMillis(); + forkTask.setScheduledTime(epochMillis); forkTask.setStartTime(epochMillis); forkTask.setEndTime(epochMillis); forkTask.setInputData(taskInput); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/HumanTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/HumanTaskMapper.java index 9a18bfd2fe..9c912e3f52 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/HumanTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/HumanTaskMapper.java @@ -65,7 +65,9 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { TaskModel humanTask = taskMapperContext.createTaskModel(); humanTask.setTaskType(TASK_TYPE_HUMAN); humanTask.setInputData(humanTaskInput); - humanTask.setStartTime(System.currentTimeMillis()); + final long currentTimeMillis = System.currentTimeMillis(); + humanTask.setScheduledTime(currentTimeMillis); + humanTask.setStartTime(currentTimeMillis); humanTask.setStatus(TaskModel.Status.IN_PROGRESS); return List.of(humanTask); } diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/InlineTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/InlineTaskMapper.java index 9125f0139b..af5bffd50d 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/InlineTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/InlineTaskMapper.java @@ -73,7 +73,9 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { TaskModel inlineTask = taskMapperContext.createTaskModel(); inlineTask.setTaskType(TaskType.TASK_TYPE_INLINE); - inlineTask.setStartTime(System.currentTimeMillis()); + final long currentTimeMillis = System.currentTimeMillis(); + inlineTask.setScheduledTime(currentTimeMillis); + inlineTask.setStartTime(currentTimeMillis); inlineTask.setInputData(taskInput); inlineTask.setStatus(TaskModel.Status.IN_PROGRESS); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/JoinTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/JoinTaskMapper.java index 02f2bb8663..742fabeeb5 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/JoinTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/JoinTaskMapper.java @@ -62,7 +62,9 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { TaskModel joinTask = taskMapperContext.createTaskModel(); joinTask.setTaskType(TaskType.TASK_TYPE_JOIN); joinTask.setTaskDefName(TaskType.TASK_TYPE_JOIN); - joinTask.setStartTime(System.currentTimeMillis()); + final long currentTimeMillis = System.currentTimeMillis(); + joinTask.setScheduledTime(currentTimeMillis); + joinTask.setStartTime(currentTimeMillis); joinTask.setInputData(joinInput); joinTask.setStatus(TaskModel.Status.IN_PROGRESS); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/JsonJQTransformTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/JsonJQTransformTaskMapper.java index 7aeabd81c7..3ccde4b952 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/JsonJQTransformTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/JsonJQTransformTaskMapper.java @@ -63,7 +63,9 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { workflowTask.getInputParameters(), workflowModel, taskId, taskDefinition); TaskModel jsonJQTransformTask = taskMapperContext.createTaskModel(); - jsonJQTransformTask.setStartTime(System.currentTimeMillis()); + final long currentTimeMillis = System.currentTimeMillis(); + jsonJQTransformTask.setScheduledTime(currentTimeMillis); + jsonJQTransformTask.setStartTime(currentTimeMillis); jsonJQTransformTask.setInputData(taskInput); jsonJQTransformTask.setStatus(TaskModel.Status.IN_PROGRESS); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/LambdaTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/LambdaTaskMapper.java index 52e08be777..01149b650c 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/LambdaTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/LambdaTaskMapper.java @@ -74,7 +74,9 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { TaskModel lambdaTask = taskMapperContext.createTaskModel(); lambdaTask.setTaskType(TaskType.TASK_TYPE_LAMBDA); - lambdaTask.setStartTime(System.currentTimeMillis()); + final long currentTimeMillis = System.currentTimeMillis(); + lambdaTask.setScheduledTime(currentTimeMillis); + lambdaTask.setStartTime(currentTimeMillis); lambdaTask.setInputData(taskInput); lambdaTask.setStatus(TaskModel.Status.IN_PROGRESS); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/SetVariableTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/SetVariableTaskMapper.java index a5ba3a4437..1bd806825c 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/SetVariableTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/SetVariableTaskMapper.java @@ -38,7 +38,9 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) LOGGER.debug("TaskMapperContext {} in SetVariableMapper", taskMapperContext); TaskModel varTask = taskMapperContext.createTaskModel(); - varTask.setStartTime(System.currentTimeMillis()); + final long currentTimeMillis = System.currentTimeMillis(); + varTask.setScheduledTime(currentTimeMillis); + varTask.setStartTime(currentTimeMillis); varTask.setInputData(taskMapperContext.getTaskInput()); varTask.setStatus(TaskModel.Status.IN_PROGRESS); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/SwitchTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/SwitchTaskMapper.java index 399d488a5a..92d9bace1b 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/SwitchTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/SwitchTaskMapper.java @@ -94,7 +94,9 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { switchTask.setTaskDefName(TaskType.TASK_TYPE_SWITCH); switchTask.getInputData().put("case", evalResult); switchTask.addOutput("evaluationResult", List.of(evalResult)); - switchTask.setStartTime(System.currentTimeMillis()); + final long currentTimeMillis = System.currentTimeMillis(); + switchTask.setScheduledTime(currentTimeMillis); + switchTask.setStartTime(currentTimeMillis); switchTask.setStatus(TaskModel.Status.IN_PROGRESS); tasksToBeScheduled.add(switchTask); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/TerminateTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/TerminateTaskMapper.java index e5fcf5c2b6..aa5eeaecb1 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/TerminateTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/TerminateTaskMapper.java @@ -58,7 +58,9 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { TaskModel task = taskMapperContext.createTaskModel(); task.setTaskType(TASK_TYPE_TERMINATE); - task.setStartTime(System.currentTimeMillis()); + final long currentTimeMillis = System.currentTimeMillis(); + task.setScheduledTime(currentTimeMillis); + task.setStartTime(currentTimeMillis); task.setInputData(taskInput); task.setStatus(TaskModel.Status.IN_PROGRESS); return List.of(task); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/WaitTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/WaitTaskMapper.java index 378d56bd9a..28229ec660 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/WaitTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/WaitTaskMapper.java @@ -67,7 +67,9 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { TaskModel waitTask = taskMapperContext.createTaskModel(); waitTask.setTaskType(TASK_TYPE_WAIT); waitTask.setInputData(waitTaskInput); - waitTask.setStartTime(System.currentTimeMillis()); + final long currentTimeMillis = System.currentTimeMillis(); + waitTask.setScheduledTime(currentTimeMillis); + waitTask.setStartTime(currentTimeMillis); waitTask.setStatus(TaskModel.Status.IN_PROGRESS); return List.of(waitTask); } From cc7b3308aba5eba1bd1e16ee6a40e8cf5b03a8b6 Mon Sep 17 00:00:00 2001 From: Surafel Korse Date: Mon, 10 Oct 2022 12:11:29 -0400 Subject: [PATCH 2/2] remove redundant setScheduleTime --- .../conductor/core/execution/mapper/DecisionTaskMapper.java | 4 +--- .../conductor/core/execution/mapper/DoWhileTaskMapper.java | 4 +--- .../core/execution/mapper/ExclusiveJoinTaskMapper.java | 4 +--- .../core/execution/mapper/ForkJoinDynamicTaskMapper.java | 6 ++---- .../conductor/core/execution/mapper/ForkJoinTaskMapper.java | 1 - .../conductor/core/execution/mapper/HumanTaskMapper.java | 4 +--- .../conductor/core/execution/mapper/InlineTaskMapper.java | 4 +--- .../conductor/core/execution/mapper/JoinTaskMapper.java | 4 +--- .../core/execution/mapper/JsonJQTransformTaskMapper.java | 4 +--- .../conductor/core/execution/mapper/LambdaTaskMapper.java | 4 +--- .../core/execution/mapper/SetVariableTaskMapper.java | 4 +--- .../conductor/core/execution/mapper/SwitchTaskMapper.java | 4 +--- .../core/execution/mapper/TerminateTaskMapper.java | 4 +--- .../conductor/core/execution/mapper/WaitTaskMapper.java | 4 +--- 14 files changed, 14 insertions(+), 41 deletions(-) diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/DecisionTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/DecisionTaskMapper.java index 9c60087112..45b2add899 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/DecisionTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/DecisionTaskMapper.java @@ -88,9 +88,7 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { decisionTask.setTaskDefName(TaskType.TASK_TYPE_DECISION); decisionTask.addInput("case", caseValue); decisionTask.addOutput("caseOutput", Collections.singletonList(caseValue)); - final long currentTimeMillis = System.currentTimeMillis(); - decisionTask.setScheduledTime(currentTimeMillis); - decisionTask.setStartTime(currentTimeMillis); + decisionTask.setStartTime(System.currentTimeMillis()); decisionTask.setStatus(TaskModel.Status.IN_PROGRESS); tasksToBeScheduled.add(decisionTask); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/DoWhileTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/DoWhileTaskMapper.java index c81ec00b64..1a0c504bea 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/DoWhileTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/DoWhileTaskMapper.java @@ -87,9 +87,7 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { TaskModel doWhileTask = taskMapperContext.createTaskModel(); doWhileTask.setTaskType(TaskType.TASK_TYPE_DO_WHILE); doWhileTask.setStatus(TaskModel.Status.IN_PROGRESS); - final long currentTimeMillis = System.currentTimeMillis(); - doWhileTask.setScheduledTime(currentTimeMillis); - doWhileTask.setStartTime(currentTimeMillis); + doWhileTask.setStartTime(System.currentTimeMillis()); doWhileTask.setRateLimitPerFrequency(taskDefinition.getRateLimitPerFrequency()); doWhileTask.setRateLimitFrequencyInSeconds(taskDefinition.getRateLimitFrequencyInSeconds()); doWhileTask.setRetryCount(taskMapperContext.getRetryCount()); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/ExclusiveJoinTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/ExclusiveJoinTaskMapper.java index a11779411a..5fdb86ea2e 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/ExclusiveJoinTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/ExclusiveJoinTaskMapper.java @@ -51,9 +51,7 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { TaskModel joinTask = taskMapperContext.createTaskModel(); joinTask.setTaskType(TaskType.TASK_TYPE_EXCLUSIVE_JOIN); joinTask.setTaskDefName(TaskType.TASK_TYPE_EXCLUSIVE_JOIN); - final long currentTimeMillis = System.currentTimeMillis(); - joinTask.setScheduledTime(currentTimeMillis); - joinTask.setStartTime(currentTimeMillis); + joinTask.setStartTime(System.currentTimeMillis()); joinTask.setInputData(joinInput); joinTask.setStatus(TaskModel.Status.IN_PROGRESS); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinDynamicTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinDynamicTaskMapper.java index 3b1e55c526..905424b0c2 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinDynamicTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinDynamicTaskMapper.java @@ -251,10 +251,8 @@ TaskModel createDynamicForkTask( TaskModel forkDynamicTask = taskMapperContext.createTaskModel(); forkDynamicTask.setTaskType(TaskType.TASK_TYPE_FORK); forkDynamicTask.setTaskDefName(TaskType.TASK_TYPE_FORK); - final long currentTimeMillis = System.currentTimeMillis(); - forkDynamicTask.setScheduledTime(currentTimeMillis); - forkDynamicTask.setStartTime(currentTimeMillis); - forkDynamicTask.setEndTime(currentTimeMillis); + forkDynamicTask.setStartTime(System.currentTimeMillis()); + forkDynamicTask.setEndTime(System.currentTimeMillis()); List forkedTaskNames = dynForkTasks.stream() .map(WorkflowTask::getTaskReferenceName) diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinTaskMapper.java index e4b79f8f6d..c90b5a6f44 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/ForkJoinTaskMapper.java @@ -74,7 +74,6 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) forkTask.setTaskType(TaskType.TASK_TYPE_FORK); forkTask.setTaskDefName(TaskType.TASK_TYPE_FORK); long epochMillis = System.currentTimeMillis(); - forkTask.setScheduledTime(epochMillis); forkTask.setStartTime(epochMillis); forkTask.setEndTime(epochMillis); forkTask.setInputData(taskInput); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/HumanTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/HumanTaskMapper.java index 9c912e3f52..9a18bfd2fe 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/HumanTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/HumanTaskMapper.java @@ -65,9 +65,7 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { TaskModel humanTask = taskMapperContext.createTaskModel(); humanTask.setTaskType(TASK_TYPE_HUMAN); humanTask.setInputData(humanTaskInput); - final long currentTimeMillis = System.currentTimeMillis(); - humanTask.setScheduledTime(currentTimeMillis); - humanTask.setStartTime(currentTimeMillis); + humanTask.setStartTime(System.currentTimeMillis()); humanTask.setStatus(TaskModel.Status.IN_PROGRESS); return List.of(humanTask); } diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/InlineTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/InlineTaskMapper.java index af5bffd50d..9125f0139b 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/InlineTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/InlineTaskMapper.java @@ -73,9 +73,7 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { TaskModel inlineTask = taskMapperContext.createTaskModel(); inlineTask.setTaskType(TaskType.TASK_TYPE_INLINE); - final long currentTimeMillis = System.currentTimeMillis(); - inlineTask.setScheduledTime(currentTimeMillis); - inlineTask.setStartTime(currentTimeMillis); + inlineTask.setStartTime(System.currentTimeMillis()); inlineTask.setInputData(taskInput); inlineTask.setStatus(TaskModel.Status.IN_PROGRESS); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/JoinTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/JoinTaskMapper.java index 742fabeeb5..02f2bb8663 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/JoinTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/JoinTaskMapper.java @@ -62,9 +62,7 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { TaskModel joinTask = taskMapperContext.createTaskModel(); joinTask.setTaskType(TaskType.TASK_TYPE_JOIN); joinTask.setTaskDefName(TaskType.TASK_TYPE_JOIN); - final long currentTimeMillis = System.currentTimeMillis(); - joinTask.setScheduledTime(currentTimeMillis); - joinTask.setStartTime(currentTimeMillis); + joinTask.setStartTime(System.currentTimeMillis()); joinTask.setInputData(joinInput); joinTask.setStatus(TaskModel.Status.IN_PROGRESS); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/JsonJQTransformTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/JsonJQTransformTaskMapper.java index 3ccde4b952..7aeabd81c7 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/JsonJQTransformTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/JsonJQTransformTaskMapper.java @@ -63,9 +63,7 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { workflowTask.getInputParameters(), workflowModel, taskId, taskDefinition); TaskModel jsonJQTransformTask = taskMapperContext.createTaskModel(); - final long currentTimeMillis = System.currentTimeMillis(); - jsonJQTransformTask.setScheduledTime(currentTimeMillis); - jsonJQTransformTask.setStartTime(currentTimeMillis); + jsonJQTransformTask.setStartTime(System.currentTimeMillis()); jsonJQTransformTask.setInputData(taskInput); jsonJQTransformTask.setStatus(TaskModel.Status.IN_PROGRESS); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/LambdaTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/LambdaTaskMapper.java index 01149b650c..52e08be777 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/LambdaTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/LambdaTaskMapper.java @@ -74,9 +74,7 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { TaskModel lambdaTask = taskMapperContext.createTaskModel(); lambdaTask.setTaskType(TaskType.TASK_TYPE_LAMBDA); - final long currentTimeMillis = System.currentTimeMillis(); - lambdaTask.setScheduledTime(currentTimeMillis); - lambdaTask.setStartTime(currentTimeMillis); + lambdaTask.setStartTime(System.currentTimeMillis()); lambdaTask.setInputData(taskInput); lambdaTask.setStatus(TaskModel.Status.IN_PROGRESS); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/SetVariableTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/SetVariableTaskMapper.java index 1bd806825c..a5ba3a4437 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/SetVariableTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/SetVariableTaskMapper.java @@ -38,9 +38,7 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) LOGGER.debug("TaskMapperContext {} in SetVariableMapper", taskMapperContext); TaskModel varTask = taskMapperContext.createTaskModel(); - final long currentTimeMillis = System.currentTimeMillis(); - varTask.setScheduledTime(currentTimeMillis); - varTask.setStartTime(currentTimeMillis); + varTask.setStartTime(System.currentTimeMillis()); varTask.setInputData(taskMapperContext.getTaskInput()); varTask.setStatus(TaskModel.Status.IN_PROGRESS); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/SwitchTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/SwitchTaskMapper.java index 92d9bace1b..399d488a5a 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/SwitchTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/SwitchTaskMapper.java @@ -94,9 +94,7 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { switchTask.setTaskDefName(TaskType.TASK_TYPE_SWITCH); switchTask.getInputData().put("case", evalResult); switchTask.addOutput("evaluationResult", List.of(evalResult)); - final long currentTimeMillis = System.currentTimeMillis(); - switchTask.setScheduledTime(currentTimeMillis); - switchTask.setStartTime(currentTimeMillis); + switchTask.setStartTime(System.currentTimeMillis()); switchTask.setStatus(TaskModel.Status.IN_PROGRESS); tasksToBeScheduled.add(switchTask); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/TerminateTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/TerminateTaskMapper.java index aa5eeaecb1..e5fcf5c2b6 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/TerminateTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/TerminateTaskMapper.java @@ -58,9 +58,7 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { TaskModel task = taskMapperContext.createTaskModel(); task.setTaskType(TASK_TYPE_TERMINATE); - final long currentTimeMillis = System.currentTimeMillis(); - task.setScheduledTime(currentTimeMillis); - task.setStartTime(currentTimeMillis); + task.setStartTime(System.currentTimeMillis()); task.setInputData(taskInput); task.setStatus(TaskModel.Status.IN_PROGRESS); return List.of(task); diff --git a/core/src/main/java/com/netflix/conductor/core/execution/mapper/WaitTaskMapper.java b/core/src/main/java/com/netflix/conductor/core/execution/mapper/WaitTaskMapper.java index 28229ec660..378d56bd9a 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/mapper/WaitTaskMapper.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/mapper/WaitTaskMapper.java @@ -67,9 +67,7 @@ public List getMappedTasks(TaskMapperContext taskMapperContext) { TaskModel waitTask = taskMapperContext.createTaskModel(); waitTask.setTaskType(TASK_TYPE_WAIT); waitTask.setInputData(waitTaskInput); - final long currentTimeMillis = System.currentTimeMillis(); - waitTask.setScheduledTime(currentTimeMillis); - waitTask.setStartTime(currentTimeMillis); + waitTask.setStartTime(System.currentTimeMillis()); waitTask.setStatus(TaskModel.Status.IN_PROGRESS); return List.of(waitTask); }