Skip to content

Commit

Permalink
bugfix : fix rpcContext.getClientRMHolderMap() npe (apache#4928)
Browse files Browse the repository at this point in the history
  • Loading branch information
doubleDimple authored Sep 13, 2022
1 parent 247cf21 commit bdb54a0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions core/src/main/java/io/seata/core/rpc/netty/ChannelManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,13 @@ public static Channel getSameClientChannel(Channel channel) {
ConcurrentMap<Integer, RpcContext> clientRpcMap = TM_CHANNELS.get(clientIdentified);
return getChannelFromSameClientMap(clientRpcMap, clientPort);
} else if (clientRole == NettyPoolKey.TransactionRole.RMROLE) {
for (Map<Integer, RpcContext> clientRmMap : rpcContext.getClientRMHolderMap().values()) {
Channel sameClientChannel = getChannelFromSameClientMap(clientRmMap, clientPort);
if (sameClientChannel != null) {
return sameClientChannel;
ConcurrentMap<String, ConcurrentMap<Integer, RpcContext>> clientRMHolderMap = rpcContext.getClientRMHolderMap();
if (CollectionUtils.isNotEmpty(clientRMHolderMap)) {
for (Map<Integer, RpcContext> clientRmMap : clientRMHolderMap.values()) {
Channel sameClientChannel = getChannelFromSameClientMap(clientRmMap, clientPort);
if (sameClientChannel != null) {
return sameClientChannel;
}
}
}
}
Expand Down

0 comments on commit bdb54a0

Please sign in to comment.