parent
f995ef506c
commit
91594eccfa
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue