{"record":{"id":"f2bf6281a3e3483a","repo":"apache/incubator-seata","slug":"channel-is-error","errorCode":null,"errorMessage":"channel is error.","messagePattern":"channel is error\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/seata/core/rpc/netty/AbstractNettyRemotingServer.java","lineNumber":114,"sourceCode":"        super.sendAsync(channel, rpcMessage);\n    }\n\n    @Override\n    public void sendAsyncResponse(RpcMessage rpcMessage, Channel channel, Object msg) {\n        Channel clientChannel = channel;\n        if (!(msg instanceof HeartbeatMessage)) {\n            clientChannel = ChannelManager.getSameClientChannel(channel);\n        }\n        if (clientChannel != null) {\n            RpcMessage rpcMsg = buildResponseMessage(\n                    rpcMessage,\n                    msg,\n                    msg instanceof HeartbeatMessage\n                            ? ProtocolConstants.MSGTYPE_HEARTBEAT_RESPONSE\n                            : ProtocolConstants.MSGTYPE_RESPONSE);\n            super.sendAsync(clientChannel, rpcMsg);\n        } else {\n            throw new RuntimeException(\"channel is error.\");\n        }\n    }\n\n    @Override\n    public void registerProcessor(int messageType, RemotingProcessor processor, ExecutorService executor) {\n        Pair<RemotingProcessor, ExecutorService> pair = new Pair<>(processor, executor);\n        this.processorTable.put(messageType, pair);\n    }\n\n    /**\n     * Gets listen port.\n     *\n     * @return the listen port\n     */\n    public int getListenPort() {\n        return serverBootstrap.getListenPort();\n    }\n","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/apache/incubator-seata/blob/e01f97c6db397165050caa6764020410c2c8199a/core/src/main/java/org/apache/seata/core/rpc/netty/AbstractNettyRemotingServer.java#L96-L132","documentation":"Server-side error from AbstractNettyRemotingServer.sendAsyncResponse: when replying to a client request, the TC could not find the channel to answer on. For non-heartbeat messages it re-resolves the channel via ChannelManager.getSameClientChannel(channel); a null result means the client behind that channel is no longer registered, so the response is undeliverable.","triggerScenarios":"The TC processing an RM/TM request and calling sendAsyncResponse after the requesting client has disconnected or been unregistered (channel closed between request receipt and response send); heartbeat messages bypass the lookup and use the inbound channel directly.","commonSituations":"Client timeout shorter than server processing time, so the client closes the connection before the response; client crash/restart mid-request; channel idle-evicted while its messages were still queued on the server executor.","solutions":["Increase the client's request timeout so it does not drop the connection before the TC replies","Check server message executor saturation (long task processing delays responses past channel lifetime)","Verify clients are not being prematurely disconnected by idle/heartbeat settings","The dropped response is usually recoverable: the client retries or re-registers; monitor for repeated occurrences rather than one-offs"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"Channel target = (msg instanceof HeartbeatMessage) ? channel : ChannelManager.getSameClientChannel(channel);\nif (target == null) { /* client gone: skip response, log */ return; }","typeGuard":null,"tryCatchPattern":"catch (RuntimeException e) {\n    if (\"channel is error.\".equals(e.getMessage())) {\n        // response undeliverable: log clientId and rely on client retry/timeout\n    }\n}","preventionTips":["Set client request timeouts above worst-case server processing time","Keep server message executors from saturating (bounded queues, monitoring)","Expect occasional lost responses; make clients idempotent/retrying"],"tags":["server","response","disconnected","netty"],"backgroundTag":null,"analyzedSha":"e01f97c6db397165050caa6764020410c2c8199a","analyzedAt":"2026-08-14T10:23:53.097Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}