From 7bec05c7890bfd2d0405fc0bd1eeb2f5f0ac3a7d Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Thu, 16 Nov 2023 15:22:04 +0800 Subject: [PATCH] Fix go away handler --- .../apache/dubbo/rpc/protocol/tri/TripleHttp2Protocol.java | 2 +- .../dubbo/rpc/protocol/tri/transport/TripleGoAwayHandler.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TripleHttp2Protocol.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TripleHttp2Protocol.java index 56752eb8fee..ba1ae2e05e3 100644 --- a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TripleHttp2Protocol.java +++ b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TripleHttp2Protocol.java @@ -167,8 +167,8 @@ public void configClientPipeline(URL url, ChannelOperator operator, ContextOpera List handlers = new ArrayList<>(); handlers.add(new ChannelHandlerPretender(codec)); handlers.add(new ChannelHandlerPretender(new Http2MultiplexHandler(new ChannelDuplexHandler()))); - handlers.add(new ChannelHandlerPretender(new TripleGoAwayHandler())); handlers.add(new ChannelHandlerPretender(new TriplePingPongHandler(UrlUtils.getCloseTimeout(url)))); + handlers.add(new ChannelHandlerPretender(new TripleGoAwayHandler())); handlers.add(new ChannelHandlerPretender(new TripleTailHandler())); operator.configChannelHandler(handlers); } diff --git a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/transport/TripleGoAwayHandler.java b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/transport/TripleGoAwayHandler.java index 3da48c1d6f0..6eb8fb7515a 100644 --- a/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/transport/TripleGoAwayHandler.java +++ b/dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/transport/TripleGoAwayHandler.java @@ -42,7 +42,9 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception + ctx.channel().remoteAddress() + " and will reconnect later."); } connectionHandler.onGoAway(ctx.channel()); + ReferenceCountUtil.release(msg); + return; } - ReferenceCountUtil.release(msg); + super.channelRead(ctx, msg); } }