From e1a084498f7bccb2786084ad52bbefb6d8d2ca5b Mon Sep 17 00:00:00 2001 From: Manan Bhatt Date: Wed, 2 Mar 2022 11:21:40 +0530 Subject: [PATCH 1/2] Wait and check only for current iteration task to get completed. Wait and check only for current iteration task to get completed. --- .../netflix/conductor/core/execution/tasks/DoWhile.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java b/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java index acd54aa08a..953a72ecfd 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java @@ -70,7 +70,8 @@ public boolean execute( for (TaskModel t : workflow.getTasks()) { if (task.getWorkflowTask() .has(TaskUtils.removeIterationFromTaskRefName(t.getReferenceTaskName())) - && !task.getReferenceTaskName().equals(t.getReferenceTaskName())) { + && !task.getReferenceTaskName().equals(t.getReferenceTaskName()) + && task.getIteration() == t.getIteration()) { relevantTask = relevantTasks.get(t.getReferenceTaskName()); if (relevantTask == null || t.getRetryCount() > relevantTask.getRetryCount()) { relevantTasks.put(t.getReferenceTaskName(), t); @@ -78,7 +79,10 @@ public boolean execute( } } Collection loopOver = relevantTasks.values(); - + LOGGER.debug( + "Workflow {} waiting for tasks {} to complete iteration {}", + workflow.getWorkflowId(), loopOver.stream().map(TaskModel::getReferenceTaskName).collect(Collectors.toList()), + task.getIteration()); for (TaskModel loopOverTask : loopOver) { TaskModel.Status taskStatus = loopOverTask.getStatus(); hasFailures = !taskStatus.isSuccessful(); From 9322716e93e8141a4d0785bfe4f376e6826a5ca4 Mon Sep 17 00:00:00 2001 From: Manan Bhatt Date: Wed, 2 Mar 2022 11:32:29 +0530 Subject: [PATCH 2/2] format plugin --- .../com/netflix/conductor/core/execution/tasks/DoWhile.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java b/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java index 953a72ecfd..58366fdcf7 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/tasks/DoWhile.java @@ -81,7 +81,8 @@ public boolean execute( Collection loopOver = relevantTasks.values(); LOGGER.debug( "Workflow {} waiting for tasks {} to complete iteration {}", - workflow.getWorkflowId(), loopOver.stream().map(TaskModel::getReferenceTaskName).collect(Collectors.toList()), + workflow.getWorkflowId(), + loopOver.stream().map(TaskModel::getReferenceTaskName).collect(Collectors.toList()), task.getIteration()); for (TaskModel loopOverTask : loopOver) { TaskModel.Status taskStatus = loopOverTask.getStatus();