{"record":{"id":"db4fb1c6250b9322","repo":"apache/dolphinscheduler","slug":"the-current-datax-task-has-been-interrupted","errorCode":null,"errorMessage":"The current DataX task has been interrupted","messagePattern":"The current DataX task has been interrupted","errorType":"exception","errorClass":"TaskException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-datax/src/main/java/org/apache/dolphinscheduler/plugin/task/datax/DataxTask.java","lineNumber":150,"sourceCode":"    @Override\n    public void handle(TaskCallBack taskCallBack) throws TaskException {\n        try {\n            // replace placeholder,and combine local and global parameters\n            Map<String, Property> paramsMap = taskRequest.getPrepareParamsMap();\n\n            IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()\n                    .properties(ParameterUtils.convert(paramsMap))\n                    .appendScript(buildCommand(buildDataxJsonFile(paramsMap), paramsMap));\n\n            TaskResponse commandExecuteResult = shellCommandExecutor.run(shellActuatorBuilder, taskCallBack);\n\n            setExitStatusCode(commandExecuteResult.getExitStatusCode());\n            setProcessId(commandExecuteResult.getProcessId());\n        } catch (InterruptedException e) {\n            Thread.currentThread().interrupt();\n            log.error(\"The current DataX task has been interrupted\", e);\n            setExitStatusCode(EXIT_CODE_FAILURE);\n            throw new TaskException(\"The current DataX task has been interrupted\", e);\n        } catch (Exception e) {\n            log.error(\"datax task error\", e);\n            setExitStatusCode(EXIT_CODE_FAILURE);\n            throw new TaskException(\"Execute DataX task failed\", e);\n        }\n    }\n\n    /**\n     * cancel DataX process\n     *\n     * @throws TaskException if error throws Exception\n     */\n    @Override\n    public void cancel() throws TaskException {\n        // cancel process\n        try {\n            shellCommandExecutor.cancelApplication();\n        } catch (Exception e) {","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-datax/src/main/java/org/apache/dolphinscheduler/plugin/task/datax/DataxTask.java#L132-L168","documentation":"InterruptedException was caught while the DataX shell command ran — the master or a user killed the running task, interrupting the waiting worker thread. The handler restores the interrupt flag, sets the failure/kill exit code path, and rethrows as TaskException so the task is recorded as interrupted rather than failed with a bogus exit code.","triggerScenarios":"Thrown at dolphinscheduler-task-plugin/dolphinscheduler-task-datax/src/main/java/org/apache/dolphinscheduler/plugin/task/datax/DataxTask.java:150 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No fix needed when the kill was intentional — the task is marked killed","If tasks are interrupted spuriously, check worker thread pool shutdown/rebalance events and JVM shutdowns","Ensure the datax process is actually terminated by the cancel path so it does not orphan running processes"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}