You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "aaron-ai (via GitHub)" <gi...@apache.org> on 2023/03/28 06:42:26 UTC

[GitHub] [rocketmq] aaron-ai commented on a diff in pull request #6337: fix(remoting): fix forgetting doAfterRPCHooks in Async

aaron-ai commented on code in PR #6337:
URL: https://github.com/apache/rocketmq/pull/6337#discussion_r1150096591


##########
remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingAbstract.java:
##########
@@ -355,19 +355,22 @@ private Runnable buildProcessRequestHandler(ChannelHandlerContext ctx, RemotingC
     public void processResponseCommand(ChannelHandlerContext ctx, RemotingCommand cmd) {
         final int opaque = cmd.getOpaque();
         final ResponseFuture responseFuture = responseTable.get(opaque);
+        final String remoteAddr = ctx == null ? "" : RemotingHelper.parseChannelRemoteAddr(ctx.channel());
         if (responseFuture != null) {
             responseFuture.setResponseCommand(cmd);
 
             responseTable.remove(opaque);
 
+            doAfterRpcHooks(remoteAddr, responseFuture.getRequestCommand(), cmd);
+
             if (responseFuture.getInvokeCallback() != null) {
                 executeInvokeCallback(responseFuture);
             } else {
                 responseFuture.putResponse(cmd);
                 responseFuture.release();
             }
         } else {
-            log.warn("receive response, but not matched any request, " + RemotingHelper.parseChannelRemoteAddr(ctx.channel()));
+            log.warn("receive response, but not matched any request, " + remoteAddr);

Review Comment:
   ```suggestion
               log.warn("receive response, but not matched any request, remote address={}", remoteAddr);
   ```



-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org