qsrg commented on code in PR #3975:
URL: https://github.com/apache/rocketmq/pull/3975#discussion_r853871620


##########
remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java:
##########
@@ -707,5 +711,25 @@ public void exceptionCaught(ChannelHandlerContext ctx, 
Throwable cause) throws E
                 NettyRemotingClient.this.putNettyEvent(new 
NettyEvent(NettyEventType.EXCEPTION, remoteAddress, ctx.channel()));
             }
         }
+
+        @Override
+        public void channelInactive(ChannelHandlerContext ctx) throws 
Exception {
+            Channel channel = ctx.channel();
+            if (null == channel) {
+                return;
+            }
+            if (responseTable != null) {
+                Iterator<Map.Entry<Integer, ResponseFuture>> it = 
responseTable.entrySet().iterator();
+                while (it.hasNext()) {
+                    Map.Entry<Integer, ResponseFuture> entry = it.next();
+                    if (channel == entry.getValue().getProcessChannel()) {
+                        final String remoteAddress = 
RemotingHelper.parseChannelRemoteAddr(ctx.channel());
+                        log.warn("NETTY CLIENT PIPELINE: channelInactive, so 
wakeup response, the channel[{}]", remoteAddress);
+                        entry.getValue().wakeupResponse();
+                    }
+                }
+            }
+            super.channelInactive(ctx);
+        }

Review Comment:
   I have optimized the structure, migrate wakeup logic to 
NettyRemotingAbstract. Similar to NettyRemotingAbstract#failFast, scan is 
required. 
   
   
   
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to