apache/dolphinscheduler · error · TaskReassignMasterHostException

"Take over task: " + taskExecution.getName() + " from execut

Error message

"Take over task: " + taskExecution.getName() + " from executor failed"

What it means

This message wraps any exception thrown while asking a remote executor (via the delegator client) to take over (reassign master host for) a running task during master failover. TaskExecutorClient.reassignWorkflowInstanceHost delegates to getTaskExecutorClientDelegator(taskExecution).reassignMasterHost; any failure there (network, timeout, RPC error) is rethrown as TaskReassignMasterHostException with the task name in the message. It signals that the task handover to the new master could not be completed.

Source

Thrown at dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/task/client/TaskExecutorClient.java:69

    @Override
    public void dispatch(ITaskExecution taskExecution) throws TaskDispatchException {
        try {
            getTaskExecutorClientDelegator(taskExecution).dispatch(taskExecution);
        } catch (TaskDispatchException taskDispatchException) {
            throw taskDispatchException;
        } catch (Exception ex) {
            throw new TaskDispatchException("Dispatch task: " + taskExecution.getName() + " to executor failed",
                    ex);
        }
    }

    @Override
    public boolean reassignWorkflowInstanceHost(final ITaskExecution taskExecution) throws TaskReassignMasterHostException {
        try {
            return getTaskExecutorClientDelegator(taskExecution)
                    .reassignMasterHost(taskExecution);
        } catch (Exception ex) {
            throw new TaskReassignMasterHostException(
                    "Take over task: " + taskExecution.getName() + " from executor failed",
                    ex);
        }
    }

    @Override
    public void pause(final ITaskExecution taskExecution) throws TaskPauseException {
        try {
            getTaskExecutorClientDelegator(taskExecution).pause(taskExecution);
        } catch (Exception ex) {
            throw new TaskPauseException("Pause task: " + taskExecution.getName() + " from executor failed",
                    ex);
        }
    }

    @Override
    public void kill(final ITaskExecution taskExecution) throws TaskKillException {
        try {

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Verify network connectivity from the master to the executor host/port (ping, telnet, check firewall/security groups).
  2. Check the executor/worker logs for the root cause exception carried as the cause of TaskReassignMasterHostException.
  3. Retry the failover take-over once the executor is back; DolphinScheduler retries failed tasks if configured.
  4. Confirm worker address configuration and that the executor process is running and registered with the registry center.

Example fix

// before: blindly reassigning during failover
client.reassignWorkflowInstanceHost(taskExecution);

// after: check executor reachability and handle failure
try {
    client.reassignWorkflowInstanceHost(taskExecution);
} catch (TaskReassignMasterHostException e) {
    log.error("Task {} take-over failed, will rely on failover retry", taskExecution.getName(), e.getCause());
    failoverRetryQueue.add(taskExecution);
}
Defensive patterns

Strategy: try-catch

Validate before calling

// before reassigning, check executor reachability
boolean reachable = false;
try (Socket s = new Socket()) {
    s.connect(new InetSocketAddress(taskExecution.getHost(), workerPort), 3000);
    reachable = true;
} catch (IOException ignored) { }
if (!reachable) throw new IllegalStateException("Executor host unreachable, skip reassign");

Try / catch

try {
    client.reassignWorkflowInstanceHost(taskExecution);
} catch (TaskReassignMasterHostException e) {
    log.error("Take over of {} failed, cause: {}", taskExecution.getName(), e.getCause().getMessage());
    scheduleFailoverRetry(taskExecution);
}

Prevention

When it happens

Trigger: Calling reassignWorkflowInstanceHost(ITaskExecution) when the target executor is unreachable, the RPC call times out, the executor rejects the reassign request, or the delegator lookup/dispatch itself throws any Exception.

Common situations: Master failover after a master crash while workers/executors are down or partitioned; network misconfiguration between master and worker (wrong worker address, firewall, DNS); executor busy or restarted during take-over; version mismatch in the RPC contract between master and executor.

Related errors


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/30652d96a6c4541c. Report an issue: GitHub.