From efbed09de37e1108e06ce2a115a318c439106b82 Mon Sep 17 00:00:00 2001 From: ColinZou Date: Thu, 12 Dec 2024 11:10:28 +0800 Subject: [PATCH] fix: latter task cannot be executed because taskResult.getLogs() can return null and decide(workflowId) will not be invoked --- .../conductor/core/execution/WorkflowExecutorOps.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutorOps.java b/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutorOps.java index 6affdff81..ecc9eda2b 100644 --- a/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutorOps.java +++ b/core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutorOps.java @@ -869,10 +869,13 @@ public TaskModel updateTask(TaskResult taskResult) { task.getTaskId(), workflowId); LOGGER.error(errorMsg, e); } - - taskResult.getLogs().forEach(taskExecLog -> taskExecLog.setTaskId(task.getTaskId())); - executionDAOFacade.addTaskExecLog(taskResult.getLogs()); - + List taskLogs = taskResult.getLogs(); + Optional.ofNullable(taskLogs) + .ifPresent( + logs -> { + logs.forEach(taskExecLog -> taskExecLog.setTaskId(task.getTaskId())); + executionDAOFacade.addTaskExecLog(taskLogs); + }); if (task.getStatus().isTerminal()) { long duration = getTaskDuration(0, task); long lastDuration = task.getEndTime() - task.getStartTime();