Bughue commented on code in PR #7095: URL: https://github.com/apache/incubator-seata/pull/7095#discussion_r1963363399
########## core/src/main/java/org/apache/seata/core/rpc/netty/AbstractNettyRemotingClient.java: ########## @@ -193,6 +198,7 @@ public Object sendSyncRequest(Channel channel, Object msg) throws TimeoutExcepti return null; } RpcMessage rpcMessage = buildRequestMessage(msg, ProtocolConstants.MSGTYPE_RESQUEST_SYNC); + channelToRequestIds.computeIfAbsent(channel, ch -> ConcurrentHashMap.newKeySet()).add(rpcMessage.getId()); Review Comment: Should the computeIfAbsent operation be extracted method? and integrated with super.sendSync? Avoid code duplication and missing calls ########## core/src/main/java/org/apache/seata/core/rpc/netty/AbstractNettyRemotingClient.java: ########## @@ -222,6 +229,7 @@ public void sendAsyncRequest(Channel channel, Object msg) { public void sendAsyncResponse(String serverAddress, RpcMessage rpcMessage, Object msg) { RpcMessage rpcMsg = buildResponseMessage(rpcMessage, msg, ProtocolConstants.MSGTYPE_RESPONSE); Channel channel = clientChannelManager.acquireChannel(serverAddress); + channelToRequestIds.computeIfAbsent(channel, ch -> ConcurrentHashMap.newKeySet()).add(rpcMessage.getId()); Review Comment: Is fast-failure necessary for AsyncSend? Is there Future waiting in this case? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org For additional commands, e-mail: notifications-h...@seata.apache.org