{"record":{"id":"972a1161a09fbbfb","repo":"apache/dolphinscheduler","slug":"the-current-jupyter-task-has-been-interrupted","errorCode":null,"errorMessage":"The current Jupyter task has been interrupted","messagePattern":"The current Jupyter task has been interrupted","errorType":"exception","errorClass":"TaskException","httpStatus":null,"severity":"warning","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-jupyter/src/main/java/org/apache/dolphinscheduler/plugin/task/jupyter/JupyterTask.java","lineNumber":97,"sourceCode":"    }\n\n    // todo split handle to submit and track\n    @Override\n    public void handle(TaskCallBack taskCallBack) throws TaskException {\n        try {\n            IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()\n                    .properties(ParameterUtils.convert(taskRequest.getPrepareParamsMap()))\n                    .appendScript(buildCommand());\n\n            TaskResponse response = shellCommandExecutor.run(shellActuatorBuilder, taskCallBack);\n            setExitStatusCode(response.getExitStatusCode());\n            setAppIds(String.join(TaskConstants.COMMA, getApplicationIds()));\n            setProcessId(response.getProcessId());\n        } catch (InterruptedException e) {\n            Thread.currentThread().interrupt();\n            log.error(\"The current Jupyter task has been interrupted\", e);\n            setExitStatusCode(TaskConstants.EXIT_CODE_FAILURE);\n            throw new TaskException(\"The current Jupyter task has been interrupted\", e);\n        } catch (Exception e) {\n            log.error(\"jupyter task execution failure\", e);\n            exitStatusCode = -1;\n            throw new TaskException(\"Execute jupyter task failed\", e);\n        }\n    }\n\n    @Override\n    public void submitApplication() throws TaskException {\n\n    }\n\n    @Override\n    public void trackApplicationStatus() throws TaskException {\n\n    }\n\n    /**","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-jupyter/src/main/java/org/apache/dolphinscheduler/plugin/task/jupyter/JupyterTask.java#L79-L115","documentation":"JupyterTask.handle() catches InterruptedException while waiting on the jupyter/conda shell process and rethrows it as TaskException 'The current Jupyter task has been interrupted'. This means the worker or server cancelled or killed the task's wait (kill request, worker shutdown, timeout) rather than the notebook itself failing.","triggerScenarios":"The thread executing shellCommandExecutor.run (waiting for the jupyter nbconvert/jupyter process) receives an interrupt — task kill from UI, worker graceful shutdown, or watchdog timeout — while the process is still running.","commonSituations":"User clicks 'kill' on a long-running notebook workflow; worker restarts or is drained; process wait interrupted during deployment restart; thread pool shutdown during maintenance.","solutions":["Nothing is wrong with the notebook itself; re-run the task if the kill was unintentional.","Check worker logs for the initiating kill/shutdown event to find who interrupted the task.","If timeouts are the cause, increase task timeout settings or reduce notebook runtime.","Ensure jupyter checkpoints/output so interrupted runs can resume instead of restarting from scratch."],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"static boolean wasInterrupted(TaskException e) {\n    return e.getCause() instanceof InterruptedException;\n}","tryCatchPattern":"try {\n    jupyterTask.handle(callBack);\n} catch (TaskException e) {\n    if (e.getCause() instanceof InterruptedException) {\n        log.warn(\"jupyter task was cancelled/interrupted, not a notebook failure\");\n        Thread.currentThread().interrupt();\n    } else {\n        throw e;\n    }\n}","preventionTips":["Set realistic task timeouts so watchdogs don't interrupt long notebooks.","Avoid killing/restarting workers while notebook workflows run; drain gracefully.","Persist jupyter checkpoints to resume after interruption.","Keep task run IDs handy to correlate kills with UI actions."],"tags":["jupyter","interruption","task-kill","concurrency"],"backgroundTag":"task-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"}