{"record":{"id":"a26cdaef1a4f0e7e","repo":"apache/dolphinscheduler","slug":"kill-subworkflow-name-failed","errorCode":null,"errorMessage":"Kill SubWorkflow: ${name} failed","messagePattern":"Kill SubWorkflow: (.+?) failed","errorType":"exception","errorClass":"MasterTaskExecuteException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/executor/plugin/subworkflow/SubWorkflowControlClient.java","lineNumber":104,"sourceCode":"        } catch (Exception e) {\n            throw new MasterTaskExecuteException(\"Pause SubWorkflow: \" + subWorkflowInstance.getName() + \" failed\", e);\n        }\n    }\n\n    public WorkflowInstanceStopResponse stopWorkflowInstance(\n                                                             final WorkflowInstanceStopRequest workflowInstanceStopRequest) throws MasterTaskExecuteException {\n        final Integer subWorkflowInstanceId = workflowInstanceStopRequest.getWorkflowInstanceId();\n        final WorkflowInstance subWorkflowInstance = workflowInstanceDao.queryById(subWorkflowInstanceId);\n        if (subWorkflowInstance.getState() != WorkflowExecutionStatus.RUNNING_EXECUTION) {\n            return WorkflowInstanceStopResponse.fail(\"SubWorkflow instance is not running, cannot stop\");\n        }\n        try {\n            return Clients\n                    .withService(IWorkflowControlClient.class)\n                    .withHost(subWorkflowInstance.getHost())\n                    .stopWorkflowInstance(new WorkflowInstanceStopRequest(subWorkflowInstance.getId()));\n        } catch (Exception e) {\n            throw new MasterTaskExecuteException(\"Kill SubWorkflow: \" + subWorkflowInstance.getName() + \" failed\", e);\n        }\n    }\n}\n","sourceCodeStart":86,"sourceCodeEnd":108,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/executor/plugin/subworkflow/SubWorkflowControlClient.java#L86-L108","documentation":"SubWorkflowControlClient.stopWorkflowInstance sends a stop (kill) request to the master host owning the sub-workflow instance; any failure of that remote call is wrapped in a MasterTaskExecuteException with this message, preserving the root cause.","triggerScenarios":"Sub-workflow host master is down or unreachable, the RPC throws (instance already stopped, host mismatch after failover), or the stop request fails mid-network partition.","commonSituations":"Killing a parent workflow whose sub-workflow's master has crashed, stale host addresses in the workflow instance table after failover, network/firewall issues between master nodes.","solutions":["Inspect the cause exception and verify the sub-workflow instance's host is reachable","Check the sub workflow instance state — if already stopped, the parent retry can proceed","Fix master-to-master connectivity/registry, then retry the kill operation"],"exampleFix":"// before: stale host in t_ds_workflow_instance -> update host or wait for failover\n// after: correct host via failover or DB maintenance, then re-issue stop","handlingStrategy":"retry","validationCode":"if (subWorkflowInstance.getState().isFinished()) {\n    // already finished — skip remote stop\n    return;\n}","typeGuard":null,"tryCatchPattern":"try {\n    client.stopWorkflowInstance(request);\n} catch (MasterTaskExecuteException e) {\n    log.warn(\"Kill sub workflow failed, retrying\", e);\n    retryWithBackoff(3, () -> client.stopWorkflowInstance(request));\n}","preventionTips":["Check sub workflow state before issuing stop (finished instances fail)","Ensure registry/network between masters is healthy","After failover, refresh host info before control operations"],"tags":["subworkflow","rpc","kill"],"backgroundTag":"http-request-failed","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}