Enhance logs following up #13228 (#13229)

This commit is contained in:
Albumen Kevin 2023-10-18 11:51:40 +08:00 committed by GitHub
parent f995ef506c
commit 91594eccfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,8 @@
package org.apache.dubbo.rpc.protocol.tri.transport;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.remoting.Constants;
import org.apache.dubbo.remoting.api.connection.ConnectionHandler;
@ -27,6 +29,7 @@ import io.netty.util.ReferenceCountUtil;
public class TripleGoAwayHandler extends ChannelDuplexHandler {
private static final Logger logger = LoggerFactory.getLogger(TripleGoAwayHandler.class);
public TripleGoAwayHandler() {
}
@ -35,6 +38,9 @@ public class TripleGoAwayHandler extends ChannelDuplexHandler {
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
if (msg instanceof Http2GoAwayFrame) {
final ConnectionHandler connectionHandler = (ConnectionHandler) ctx.pipeline().get(Constants.CONNECTION_HANDLER_NAME);
if (logger.isInfoEnabled()) {
logger.info("Receive go away frame of " + ctx.channel().localAddress() + " -> " + ctx.channel().remoteAddress() + " and will reconnect later.");
}
connectionHandler.onGoAway(ctx.channel());
}
ReferenceCountUtil.release(msg);