Skip to content

Commit

Permalink
Merge pull request #85 from owenludong/master
Browse files Browse the repository at this point in the history
此Patch仅用于解决以下场景可能出现的潜在问题
1、创建同一个RemotingCommand对象,多次调用invoke方法发送rpc请求,可能会由于异步返回并发问题,导致RemotingCommand对象被意外删除。

注意:推荐用户每次发起rpc请求时,都新建一个RemotingCommand对象。
  • Loading branch information
vintagewang committed Apr 8, 2015
2 parents 6de88b8 + 2e3397e commit 3aa8b0b
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ public void processResponseCommand(ChannelHandlerContext ctx, RemotingCommand cm
final ResponseFuture responseFuture = responseTable.get(cmd.getOpaque());
if (responseFuture != null) {
responseFuture.setResponseCommand(cmd);

responseFuture.release();
responseTable.remove(cmd.getOpaque());

if (responseFuture.getInvokeCallback() != null) {
boolean runInThisThread = false;
Expand Down Expand Up @@ -295,7 +295,6 @@ public void run() {
plog.warn(cmd.toString());
}

responseTable.remove(cmd.getOpaque());
}


Expand Down

0 comments on commit 3aa8b0b

Please sign in to comment.