You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by we...@apache.org on 2024/06/27 00:25:48 UTC

(dolphinscheduler) branch 3.2.2-prepare updated: Fix worker overload will casue task failed (#16223)

This is an automated email from the ASF dual-hosted git repository.

wenjun pushed a commit to branch 3.2.2-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/3.2.2-prepare by this push:
     new f13f070242 Fix worker overload will casue task failed (#16223)
f13f070242 is described below

commit f13f0702427823774beff861264b0d7db3285aa9
Author: Wenjun Ruan <we...@apache.org>
AuthorDate: Thu Jun 27 08:25:42 2024 +0800

    Fix worker overload will casue task failed (#16223)
    
    (cherry picked from commit 4a41e4290ec25bf1165ebc4f043baffb13729a72)
---
 .../server/master/runner/BaseTaskDispatcher.java                 | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/BaseTaskDispatcher.java b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/BaseTaskDispatcher.java
index 30ab8fadec..793ae378d0 100644
--- a/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/BaseTaskDispatcher.java
+++ b/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/runner/BaseTaskDispatcher.java
@@ -55,10 +55,11 @@ public abstract class BaseTaskDispatcher implements TaskDispatcher {
             taskInstanceDispatchHost = getTaskInstanceDispatchHost(taskExecuteRunnable)
                     .orElseThrow(() -> new TaskDispatchException("Cannot find the host to execute task."));
         } catch (WorkerGroupNotFoundException workerGroupNotFoundException) {
-            log.error("Dispatch task: {} failed, worker group not found.",
-                    taskExecuteRunnable.getTaskExecutionContext().getTaskName(), workerGroupNotFoundException);
-            addDispatchFailedEvent(taskExecuteRunnable);
-            return;
+            // todo: this is a temporary solution, we should refactor the ServerNodeManager to make sure there won't
+            // throw WorkerGroupNotFoundException unless the worker group is not exist in database
+            throw new TaskDispatchException(
+                    "Dispatch task: " + taskExecuteRunnable.getTaskExecutionContext().getTaskName() + " failed",
+                    workerGroupNotFoundException);
         }
         taskExecuteRunnable.getTaskExecutionContext().setHost(taskInstanceDispatchHost.getAddress());
         doDispatch(taskExecuteRunnable);