{"record":{"id":"4e4f8273ff76f049","repo":"apache/dolphinscheduler","slug":"the-current-dvctask-has-been-interrupted","errorCode":null,"errorMessage":"The current DvcTask has been interrupted","messagePattern":"The current DvcTask has been interrupted","errorType":"exception","errorClass":"TaskException","httpStatus":null,"severity":"warning","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-dvc/src/main/java/org/apache/dolphinscheduler/plugin/task/dvc/DvcTask.java","lineNumber":75,"sourceCode":"            throw new TaskException(\"dvc task params is not valid\");\n        }\n    }\n\n    @Override\n    public void handle(TaskCallBack taskCallBack) throws TaskException {\n        try {\n            // construct process\n            IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()\n                    .appendScript(buildCommand());\n            TaskResponse commandExecuteResult = shellCommandExecutor.run(shellActuatorBuilder, taskCallBack);\n            setExitStatusCode(commandExecuteResult.getExitStatusCode());\n            setProcessId(commandExecuteResult.getProcessId());\n            parameters.dealOutParam(shellCommandExecutor.getTaskOutputParams());\n        } catch (InterruptedException e) {\n            Thread.currentThread().interrupt();\n            log.error(\"The current DvcTask has been interrupted\", e);\n            setExitStatusCode(EXIT_CODE_FAILURE);\n            throw new TaskException(\"The current DvcTask has been interrupted\", e);\n        } catch (Exception e) {\n            log.error(\"dvc task error\", e);\n            setExitStatusCode(EXIT_CODE_FAILURE);\n            throw new TaskException(\"Execute dvc task failed\", e);\n        }\n    }\n\n    @Override\n    public void cancel() throws TaskException {\n        // cancel process\n        try {\n            shellCommandExecutor.cancelApplication();\n        } catch (Exception e) {\n            throw new TaskException(\"cancel application error\", e);\n        }\n    }\n\n    public String buildCommand() {","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-dvc/src/main/java/org/apache/dolphinscheduler/plugin/task/dvc/DvcTask.java#L57-L93","documentation":"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'.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Expected on cancel/shutdown — simply re-run the DVC task; DVC operations are generally resumable.","If it appears unexpectedly, check worker logs for shutdown/kill events around the timestamp.","Reduce DVC data size / use dvc push with cache so uploads survive interruption.","Increase task timeout if the interruption stems from task timeout policy."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    dvcTask.handle(null);\n} catch (TaskException e) {\n    if (e.getMessage().contains(\"interrupted\")) {\n        Thread.currentThread().interrupt(); // propagate, treat as cancellation not failure\n    }\n}","preventionTips":["Avoid killing workers mid-DVC-upload; use graceful shutdown.","Set realistic task timeouts so cancellations are planned.","Chunk large DVC pushes to reduce interruption windows.","Treat this exception as cancellation: re-run rather than debug as a bug."],"tags":["interruption","task-cancel","dvc","shell","worker-shutdown"],"backgroundTag":"operation-interrupted","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"}