From 0a8f8155d581f57be2ef3306099ed4308ec0385b Mon Sep 17 00:00:00 2001 From: zeyu10 Date: Fri, 22 Nov 2024 16:53:22 +0800 Subject: [PATCH] fix null point exception becase of miss retry context in notifyInfo --- .../traversal/runners/FunctionTaskRunner.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rill-flow-dag/olympicene-traversal/src/main/java/com/weibo/rill/flow/olympicene/traversal/runners/FunctionTaskRunner.java b/rill-flow-dag/olympicene-traversal/src/main/java/com/weibo/rill/flow/olympicene/traversal/runners/FunctionTaskRunner.java index 95e2aa695..31ce38b79 100644 --- a/rill-flow-dag/olympicene-traversal/src/main/java/com/weibo/rill/flow/olympicene/traversal/runners/FunctionTaskRunner.java +++ b/rill-flow-dag/olympicene-traversal/src/main/java/com/weibo/rill/flow/olympicene/traversal/runners/FunctionTaskRunner.java @@ -144,14 +144,16 @@ private ExecutionResult dispatchTask(String executionId, TaskInfo taskInfo, Map< output = buildOutput(dispatchRetJson); log.info("dispatchTask success, executionId:{}, taskName:{}, output:{}", executionId, taskInfo.getName(), output); + + TaskStatus taskStatus = buildTaskStatus(output, taskInfo, taskInvokeMsg); + Retry retry = ((FunctionTask) taskInfo.getTask()).getRetry(); + RetryContext retryContext = RetryContext.builder().retryConfig(retry).taskStatus(taskStatus).taskInfo(taskInfo).build(); NotifyInfo notifyInfo = NotifyInfo.builder() .taskInfoName(taskInfo.getName()) - .taskStatus(buildTaskStatus(output, taskInfo, taskInvokeMsg)) + .taskStatus(taskStatus) + .retryContext(retryContext) .taskInvokeMsg(taskInvokeMsg) .build(); - - Retry retry = ((FunctionTask) taskInfo.getTask()).getRetry(); - RetryContext retryContext = RetryContext.builder().retryConfig(retry).taskStatus(notifyInfo.getTaskStatus()).taskInfo(taskInfo).build(); if (retryPolicy.needRetry(retryContext, output)) { return handleRetryCallback(executionId, taskInfo, notifyInfo); }