Skip to content

Commit

Permalink
bugfix: fix batch message send may return NullPointException (apache#…
Browse files Browse the repository at this point in the history
slievrly authored Jun 24, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent a22fafc commit 8d6c3ef
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion changes/en-us/develop.md
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ Add changes here for all PR submitted to the develop branch.
- [[#4678](https://github.com/seata/seata/pull/4678)] fix the error of key transport.enableRmClientBatchSendRequest cache penetration if not configure
- [[#4701](https://github.com/seata/seata/pull/4701)] fix missing command line args
- [[#4607](https://github.com/seata/seata/pull/4607)] fix bug on skipping lock check

- [[#4726](https://github.com/seata/seata/pull/4726)] fix batch message send may return NullPointException

### optimize:
- [[#4650](https://github.com/seata/seata/pull/4650)] fix some security vulnerabilities
1 change: 1 addition & 0 deletions changes/zh-cn/develop.md
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
- [[#4678](https://github.com/seata/seata/pull/4678)] 修复属性transport.enableRmClientBatchSendRequest没有配置的情况下缓存穿透的问题
- [[#4701](https://github.com/seata/seata/pull/4701)] 修复命令行参数丢失问题
- [[#4607](https://github.com/seata/seata/pull/4607)] 修复跳过全局锁校验的缺陷
- [[#4726](https://github.com/seata/seata/pull/4726)] 修复批量发送消息时可能的NPE问题

### optimize:
- [[#4650](https://github.com/seata/seata/pull/4650)] 修复安全漏洞
Original file line number Diff line number Diff line change
@@ -375,7 +375,8 @@ public void run() {
for (Integer msgId : mergeMessage.msgIds) {
MessageFuture messageFuture = futures.remove(msgId);
if (messageFuture != null) {
messageFuture.setResultMessage(null);
messageFuture.setResultMessage(
new RuntimeException(String.format("%s is unreachable", address), e));
}
}
LOGGER.error("client merge call failed: {}", e.getMessage(), e);
Original file line number Diff line number Diff line change
@@ -98,9 +98,7 @@ public void process(ChannelHandlerContext ctx, RpcMessage rpcMessage) throws Exc
int msgId = mergeMessage.msgIds.get(i);
MessageFuture future = futures.remove(msgId);
if (future == null) {
if (LOGGER.isInfoEnabled()) {
LOGGER.info("msg: {} is not found in futures.", msgId);
}
LOGGER.error("msg: {} is not found in futures, result message: {}", msgId,results.getMsgs()[i]);
} else {
future.setResultMessage(results.getMsgs()[i]);
}
@@ -112,9 +110,7 @@ public void process(ChannelHandlerContext ctx, RpcMessage rpcMessage) throws Exc
int msgId = batchResultMessage.getMsgIds().get(i);
MessageFuture future = futures.remove(msgId);
if (future == null) {
if (LOGGER.isInfoEnabled()) {
LOGGER.info("msg: {} is not found in futures.", msgId);
}
LOGGER.error("msg: {} is not found in futures, result message: {}", msgId, batchResultMessage.getResultMessages().get(i));
} else {
future.setResultMessage(batchResultMessage.getResultMessages().get(i));
}

0 comments on commit 8d6c3ef

Please sign in to comment.