apache/dolphinscheduler · error · TaskException
The current HiveCLI Task has been interrupted
Error message
The current HiveCLI Task has been interrupted
What it means
HiveCliTask.handle() runs the hive CLI via ShellCommandExecutor.run(), which blocks on the subprocess. If the worker thread waiting on the process is interrupted (task cancel/kill or worker shutdown), the InterruptedException is caught, the interrupt flag is restored, exit status is set to failure, and a TaskException('The current HiveCLI Task has been interrupted') is thrown.
Source
Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-hivecli/src/main/java/org/apache/dolphinscheduler/plugin/task/hivecli/HiveCliTask.java:102
}
}
// todo split handle to submit and track
@Override
public void handle(TaskCallBack taskCallBack) throws TaskException {
try {
IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()
.appendScript(buildCommand());
final TaskResponse taskResponse = shellCommandExecutor.run(shellActuatorBuilder, taskCallBack);
setExitStatusCode(taskResponse.getExitStatusCode());
setAppIds(taskResponse.getAppIds());
setProcessId(taskResponse.getProcessId());
setTaskOutputParams(shellCommandExecutor.getTaskOutputParams());
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.error("The current HiveCLI Task has been interrupted", e);
setExitStatusCode(EXIT_CODE_FAILURE);
throw new TaskException("The current HiveCLI Task has been interrupted", e);
} catch (Exception e) {
log.error("hiveCli task failure", e);
setExitStatusCode(EXIT_CODE_FAILURE);
throw new TaskException("run hiveCli task error", e);
}
}
@Override
public void submitApplication() throws TaskException {
}
@Override
public void trackApplicationStatus() throws TaskException {
}
protected String buildCommand() {View on GitHub (pinned to 02eac45a1b)
Solutions
- If the interruption was intentional (cancel/kill), simply accept the failure; re-run the task if the query should complete.
- Increase the task/workflow timeout or optimize the Hive query so it finishes before cancellation windows.
- Check worker logs around the interrupt to confirm it came from an expected cancel/shutdown, not a spurious thread-pool kill.
- Ensure graceful-shutdown settings give workers time to let tasks finish before interrupts are issued.
Defensive patterns
Strategy: try-catch
Try / catch
try {
task.handle(taskCallBack);
} catch (TaskException e) {
if (e.getCause() instanceof InterruptedException) {
// task was cancelled/worker interrupted: mark as cancelled, do not retry blindly
}
} Prevention
- Avoid killing the task instance unless cancellation is intended; a re-run is required after interruption
- Set realistic timeouts so long hive queries are not interrupted mid-run
- Coordinate worker shutdowns with the scheduler's graceful-drain window
- Check task instance state after interruption before retrying to avoid duplicate hive executions
When it happens
Trigger: User clicks kill/stop on the running HiveCLI task instance; the worker shuts down or the task's thread-pool is interrupted while ShellCommandExecutor.run() is waiting on the hive process; timeout-based cancellation interrupts the executing thread.
Common situations: Long-running hive queries killed by an operator or by scheduler timeout; worker restart/redeploy while a HiveCLI task was in progress; workflow-level stop cascading an interrupt to the task thread.
Related errors
- The current ChunJun Task has been interrupted
- The current DvcTask has been interrupted
- EMR Serverless task tracking interrupted
- Execute emr task failed
- hiveCli task params is not valid
AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06).
Data as JSON: /api/errors/52eebb9bc75a9776.
Report an issue: GitHub.