Skip to content

Commit

Permalink
Enhance logs following up apache#13228 (apache#13229)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbumenJ authored Oct 18, 2023
1 parent f995ef5 commit 91594ec
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -27,6 +29,7 @@

public class TripleGoAwayHandler extends ChannelDuplexHandler {

private static final Logger logger = LoggerFactory.getLogger(TripleGoAwayHandler.class);

public TripleGoAwayHandler() {
}
Expand All @@ -35,6 +38,9 @@ public TripleGoAwayHandler() {
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);
Expand Down

0 comments on commit 91594ec

Please sign in to comment.