{"record":{"id":"69e68d5908bb05cd","repo":"apache/seatunnel","slug":"command-is-not-dispatched-yet","errorCode":null,"errorMessage":"Command {} is not dispatched yet","messagePattern":"Command (.+?) is not dispatched yet","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-edge-socket/src/main/java/org/apache/seatunnel/connectors/seatunnel/edgesocket/protocol/IngressProtocolHandler.java","lineNumber":110,"sourceCode":"            channel.writeLine(dispatch(record));\n        }\n    }\n\n    private String dispatch(String request) {\n        IngressCommand command = IngressCommand.matchPrefix(request);\n        if (command == null) {\n            log.warn(\n                    \"Unrecognized command prefix, got: {}\",\n                    EdgeSocketLogUtils.abbreviateForLog(request));\n            return EdgeSocketResponseCode.BAD_REQUEST.getCode();\n        }\n        switch (command) {\n            case COMMIT:\n                return dispatchCommit(request);\n            case BATCH:\n                return dispatchBatch(request);\n            default:\n                log.warn(\"Command {} is not dispatched yet\", command);\n                return EdgeSocketResponseCode.BAD_REQUEST.getCode();\n        }\n    }\n\n    private String dispatchCommit(String request) {\n        Long batchId = parseBatchId(request, IngressCommand.COMMIT.prefix());\n        if (batchId == null || batchId <= 0) {\n            log.warn(\n                    \"Invalid COMMIT batchId in request: {}\",\n                    EdgeSocketLogUtils.abbreviateForLog(request));\n            return EdgeSocketResponseCode.INVALID_PARAM.getCode();\n        }\n        return handler.handleCommitRequest(batchId);\n    }\n\n    private String dispatchBatch(String request) {\n        int separatorIndex = request.indexOf(':', IngressCommand.BATCH.prefix().length());\n        if (separatorIndex < 0) {","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-edge-socket/src/main/java/org/apache/seatunnel/connectors/seatunnel/edgesocket/protocol/IngressProtocolHandler.java#L92-L128","documentation":"Logged in dispatch()'s default branch when a command prefix matched a known IngressCommand enum value that has no case in the switch. The server returns BAD_REQUEST. This is a developer-facing invariant warning: a new command was added to the enum but the dispatch switch was not extended.","triggerScenarios":"IngressCommand.matchPrefix returns an enum constant other than COMMIT or BATCH, i.e. the enum gained a new command (e.g. HEARTBEAT, ABORT) that dispatch() does not handle.","commonSituations":"Partial upgrade where the collector was built against a newer protocol version with extra commands but the server is an older build; local development after adding a new IngressCommand without updating the switch.","solutions":["Add a case for the unhandled command in dispatch()'s switch and implement its handler.","If the server version is intentionally older, upgrade the server to match the collector's protocol.","Ensure all IngressCommand values are covered (or add an exhaustive switch) when adding new commands."],"exampleFix":"// before\nswitch (command) {\n    case COMMIT: return dispatchCommit(request);\n    case BATCH: return dispatchBatch(request);\n// after\nswitch (command) {\n    case COMMIT: return dispatchCommit(request);\n    case BATCH: return dispatchBatch(request);\n    case ABORT: return dispatchAbort(request);","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"String resp = dispatch(request); if (EdgeSocketResponseCode.BAD_REQUEST.getCode().equals(resp)) { log.warn(\"server does not dispatch command; check protocol version\"); }","preventionTips":["When adding an IngressCommand value, update the dispatch switch in the same change","Use an exhaustive switch (no default silently ignoring) or a unit test asserting every enum value is dispatched","Keep collector/server protocol definitions in one shared module"],"tags":["protocol","incomplete-implementation","version-mismatch"],"backgroundTag":"method-not-implemented","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}