{"record":{"id":"eb35e247f5aa7112","repo":"apache/dolphinscheduler","slug":"the-current-seatunnel-task-has-been-interrupted","errorCode":null,"errorMessage":"The current SeaTunnel task has been interrupted","messagePattern":"The current SeaTunnel task has been interrupted","errorType":"exception","errorClass":"TaskException","httpStatus":null,"severity":"warning","filePath":"dolphinscheduler-task-plugin/dolphinscheduler-task-seatunnel/src/main/java/org/apache/dolphinscheduler/plugin/task/seatunnel/SeatunnelTask.java","lineNumber":102,"sourceCode":"    // todo split handle to submit and track\n    @Override\n    public void handle(TaskCallBack taskCallBack) throws TaskException {\n        try {\n            // construct process\n            String command = buildCommand();\n            IShellInterceptorBuilder<?, ?> shellActuatorBuilder = ShellInterceptorBuilderFactory.newBuilder()\n                    .appendScript(command);\n\n            TaskResponse commandExecuteResult = shellCommandExecutor.run(shellActuatorBuilder, taskCallBack);\n            setExitStatusCode(commandExecuteResult.getExitStatusCode());\n            setAppIds(String.join(TaskConstants.COMMA, getApplicationIds()));\n            setProcessId(commandExecuteResult.getProcessId());\n            seatunnelParameters.dealOutParam(shellCommandExecutor.getTaskOutputParams());\n        } catch (InterruptedException e) {\n            Thread.currentThread().interrupt();\n            log.error(\"The current SeaTunnel task has been interrupted\", e);\n            setExitStatusCode(EXIT_CODE_FAILURE);\n            throw new TaskException(\"The current SeaTunnel task has been interrupted\", e);\n        } catch (Exception e) {\n            log.error(\"SeaTunnel task error\", e);\n            setExitStatusCode(EXIT_CODE_FAILURE);\n            throw new TaskException(\"Execute Seatunnel 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    @Override","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-task-plugin/dolphinscheduler-task-seatunnel/src/main/java/org/apache/dolphinscheduler/plugin/task/seatunnel/SeatunnelTask.java#L84-L120","documentation":"SeatunnelTask.handle() runs the SeaTunnel job through ShellCommandExecutor; if the worker thread is interrupted while waiting on the process, it restores the interrupt flag, sets exit code failure, and throws TaskException(\"The current SeaTunnel task has been interrupted\"). It signals the task was cancelled or the worker is shutting down, not a SeaTunnel job defect.","triggerScenarios":"InterruptedException caught around shellCommandExecutor.run / command execution — user clicks Kill, master sends a cancel signal, or the worker is gracefully shutting down and interrupts running task threads.","commonSituations":"Long-running SeaTunnel jobs killed from the UI, worker maintenance/stop while jobs are running, task timeout triggering cancellation.","solutions":["This is an expected cancellation path: verify whether the task was intentionally killed; if so, no fix needed.","Check the chained cause for who interrupted; worker shutdown logs will confirm maintenance.","Re-run the task once the worker is back up; SeaTunnel jobs are not resumed automatically.","If kills happen unexpectedly, check master-worker connectivity and timeout settings in the workflow definition."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    task.handle(callback);\n} catch (TaskException e) {\n    if (e.getMessage().contains(\"interrupted\")) {\n        Thread.interrupted(); // already re-set; treat as cancellation, not failure\n        log.info(\"SeaTunnel task cancelled by user or worker shutdown\");\n    } else throw e;\n}","preventionTips":["Avoid killing long jobs during worker maintenance; drain workers first","Set realistic task timeouts so cancellation is expected","Monitor master-worker connectivity to avoid spurious kills"],"tags":["seatunnel","interrupt","cancellation"],"backgroundTag":"task-cancelled","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"}