Skip to content

Commit 79b73a7

Browse files
committedJan 17, 2021
1 parent afca0af commit 79b73a7

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed
 

‎dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/api/PortUnificationServer.java

+1
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ protected void doClose() throws Throwable {
153153
}
154154

155155
channelGroup.close();
156+
Thread.sleep(15000);
156157
} catch (Throwable e) {
157158
logger.warn(e.getMessage(), e);
158159
}

‎dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TripleClientHandler.java

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.apache.dubbo.rpc.protocol.tri;
22

3+
import org.apache.dubbo.remoting.api.Connection;
34
import org.apache.dubbo.remoting.exchange.Request;
45

56
import io.netty.channel.ChannelDuplexHandler;
@@ -28,6 +29,10 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
2829
System.out.println("Http2 Setting");
2930
}else if(msg instanceof Http2GoAwayFrame){
3031
System.out.println("Http2 goAway!");
32+
final Connection connection = Connection.getConnectionFromChannel(ctx.channel());
33+
if (connection != null) {
34+
connection.onIdle();
35+
}
3136
}
3237
}
3338

‎dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TripleHttp2ClientResponseHandler.java

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.apache.dubbo.rpc.protocol.tri;
22

3+
import io.netty.handler.codec.http2.Http2GoAwayFrame;
34
import org.apache.dubbo.common.logger.Logger;
45
import org.apache.dubbo.common.logger.LoggerFactory;
56

@@ -16,6 +17,16 @@ public TripleHttp2ClientResponseHandler() {
1617
super(false);
1718
}
1819

20+
@Override
21+
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
22+
super.userEventTriggered(ctx, evt);
23+
if (evt instanceof Http2GoAwayFrame) {
24+
System.out.println("TripleHttp2ClientResponseHandler goaway!!!");
25+
//todo set stream refuse
26+
ctx.close();
27+
}
28+
}
29+
1930
@Override
2031
protected void channelRead0(ChannelHandlerContext ctx, Http2StreamFrame msg) throws Exception {
2132
if (msg instanceof Http2HeadersFrame) {

0 commit comments

Comments
 (0)