diff --git a/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutor.java b/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutor.java index b7baee3f84..e38f050f51 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutor.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutor.java @@ -1039,7 +1039,7 @@ public void updateTask(TaskResult taskResult) { } String workflowId = taskResult.getWorkflowInstanceId(); - WorkflowModel workflowInstance = executionDAOFacade.getWorkflowModel(workflowId, true); + WorkflowModel workflowInstance = executionDAOFacade.getWorkflowModel(workflowId, false); // FIXME Backwards compatibility for legacy workflows already running. // This code will be removed in a future version. @@ -1168,7 +1168,7 @@ public void updateTask(TaskResult taskResult) { break; } - // Throw an ApplicationException if below operations fail to avoid workflow inconsistencies. + // Throw a TransientException if below operations fail to avoid workflow inconsistencies. try { executionDAOFacade.updateTask(task); } catch (Exception e) { diff --git a/core/src/test/java/com/netflix/conductor/core/execution/TestWorkflowExecutor.java b/core/src/test/java/com/netflix/conductor/core/execution/TestWorkflowExecutor.java index ba7ee03762..1a3800648b 100644 --- a/core/src/test/java/com/netflix/conductor/core/execution/TestWorkflowExecutor.java +++ b/core/src/test/java/com/netflix/conductor/core/execution/TestWorkflowExecutor.java @@ -2382,8 +2382,8 @@ public void testUpdateTaskWithCallbackAfterSeconds() { simpleTask.setTaskId("simple-task-id"); simpleTask.setStatus(TaskModel.Status.IN_PROGRESS); - workflow.getTasks().addAll(Arrays.asList(simpleTask)); - when(executionDAOFacade.getWorkflowModel(workflowId, true)).thenReturn(workflow); + workflow.getTasks().add(simpleTask); + when(executionDAOFacade.getWorkflowModel(workflowId, false)).thenReturn(workflow); when(executionDAOFacade.getTaskModel(simpleTask.getTaskId())).thenReturn(simpleTask); TaskResult taskResult = new TaskResult(); @@ -2424,8 +2424,8 @@ public void testUpdateTaskWithOutCallbackAfterSeconds() { simpleTask.setTaskId("simple-task-id"); simpleTask.setStatus(TaskModel.Status.IN_PROGRESS); - workflow.getTasks().addAll(Arrays.asList(simpleTask)); - when(executionDAOFacade.getWorkflowModel(workflowId, true)).thenReturn(workflow); + workflow.getTasks().add(simpleTask); + when(executionDAOFacade.getWorkflowModel(workflowId, false)).thenReturn(workflow); when(executionDAOFacade.getTaskModel(simpleTask.getTaskId())).thenReturn(simpleTask); TaskResult taskResult = new TaskResult();