apache/dolphinscheduler · warning · TaskException
The current Linkis task has been interrupted
Error message
The current Linkis task has been interrupted
What it means
While submitApplication() runs the Linkis job through ShellCommandExecutor, an InterruptedException means the worker thread executing the task was interrupted (workflow kill/stop or worker shutdown). The code restores the interrupt flag, logs it, sets exit status to failure, and rethrows as TaskException.
Source
Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-linkis/src/main/java/org/apache/dolphinscheduler/plugin/task/linkis/LinkisTask.java:95
}
@Override
public void submitApplication() throws TaskException {
try {
// construct process
IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()
.properties(ParameterUtils.convert(taskRequest.getPrepareParamsMap()))
.appendScript(buildCommand());
TaskResponse commandExecuteResult = shellCommandExecutor.run(shellActuatorBuilder, null);
setExitStatusCode(commandExecuteResult.getExitStatusCode());
setAppIds(findTaskId(commandExecuteResult.getResultString()));
setProcessId(commandExecuteResult.getProcessId());
linkisParameters.dealOutParam(shellCommandExecutor.getTaskOutputParams());
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.error("The current Linkis task has been interrupted", e);
setExitStatusCode(EXIT_CODE_FAILURE);
throw new TaskException("The current Linkis task has been interrupted", e);
} catch (Exception e) {
log.error("Linkis task error", e);
setExitStatusCode(EXIT_CODE_FAILURE);
throw new TaskException("Execute Linkis task failed", e);
}
}
@Override
public void trackApplicationStatus() throws TaskException {
initTaskId();
try {
List<String> args = new ArrayList<>();
args.add(Constants.SHELL_CLI_OPTIONS);
args.add(Constants.STATUS_OPTIONS);
args.add(taskId);
String command = String.join(Constants.SPACE, args);
IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()
.appendScript(command);View on GitHub (pinned to 02eac45a1b)
Solutions
- If the kill was intentional, no action needed — task exits with EXIT_CODE_FAILURE and is reported as failed/killed.
- Check workflow execution history to confirm who triggered the kill; review the attached stack trace.
- If unexpected, inspect worker logs for shutdown or watchdog events at that time.
- Rerun the workflow once the worker is stable; ensure Linkis job resubmission is safe.
Defensive patterns
Strategy: try-catch
Try / catch
try {
task.submitApplication();
} catch (TaskException e) {
if (Thread.currentThread().isInterrupted()) {
// treat as kill/shutdown: do not retry
}
} Prevention
- Avoid killing workers mid-submission; drain tasks first.
- Set kill timeouts larger than expected submission duration.
- Monitor worker shutdown logs to distinguish intentional kills.
- Make Linkis job submission idempotent for safe retries.
When it happens
Trigger: Thread.interrupt() is called on the task thread while shellCommandExecutor is executing the Linkis command — typically a kill of the task/workflow instance, or worker graceful shutdown during command execution.
Common situations: User stops/kills the workflow instance while the Linkis job runs; worker node is shutting down; a kill-timeout watchdog interrupts the executing thread.
Related errors
- Execute Linkis task failed
- cancel linkis task error
- Zookeeper registry start failed
- The current ChunJun Task has been interrupted
- The current DvcTask has been interrupted
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/3b5d6305feb0bc06.
Report an issue: GitHub.