apache/dolphinscheduler · warning · TaskException

The current DvcTask has been interrupted

Error message

The current DvcTask has been interrupted

What it means

During DvcTask.handle, if the shell command execution is interrupted (worker shutdown, task kill/cancel) the code restores the interrupt flag, logs, sets exit code to failure, and throws TaskException 'The current DvcTask has been interrupted'.

Source

Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-dvc/src/main/java/org/apache/dolphinscheduler/plugin/task/dvc/DvcTask.java:75

            throw new TaskException("dvc task params is not valid");
        }
    }

    @Override
    public void handle(TaskCallBack taskCallBack) throws TaskException {
        try {
            // construct process
            IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()
                    .appendScript(buildCommand());
            TaskResponse commandExecuteResult = shellCommandExecutor.run(shellActuatorBuilder, taskCallBack);
            setExitStatusCode(commandExecuteResult.getExitStatusCode());
            setProcessId(commandExecuteResult.getProcessId());
            parameters.dealOutParam(shellCommandExecutor.getTaskOutputParams());
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            log.error("The current DvcTask has been interrupted", e);
            setExitStatusCode(EXIT_CODE_FAILURE);
            throw new TaskException("The current DvcTask has been interrupted", e);
        } catch (Exception e) {
            log.error("dvc task error", e);
            setExitStatusCode(EXIT_CODE_FAILURE);
            throw new TaskException("Execute dvc task failed", e);
        }
    }

    @Override
    public void cancel() throws TaskException {
        // cancel process
        try {
            shellCommandExecutor.cancelApplication();
        } catch (Exception e) {
            throw new TaskException("cancel application error", e);
        }
    }

    public String buildCommand() {

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Expected on cancel/shutdown — simply re-run the DVC task; DVC operations are generally resumable.
  2. If it appears unexpectedly, check worker logs for shutdown/kill events around the timestamp.
  3. Reduce DVC data size / use dvc push with cache so uploads survive interruption.
  4. Increase task timeout if the interruption stems from task timeout policy.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    dvcTask.handle(null);
} catch (TaskException e) {
    if (e.getMessage().contains("interrupted")) {
        Thread.currentThread().interrupt(); // propagate, treat as cancellation not failure
    }
}

Prevention

When it happens

Trigger: shellCommandExecutor.run(...) (waiting on the dvc/git subprocess) throws InterruptedException because the worker thread is interrupted — task cancel/kill from the UI, worker graceful shutdown, or process timeout handling.

Common situations: User clicks stop/kill on a long-running DVC upload/download; worker restarts during deployment; the enclosing workflow is cancelled; master kills the task after timeout.

Related errors


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