reset all active stream on connection close (#12451)
* reset all active stream on connection close * reset all active stream on connection close
This commit is contained in:
parent
00d8a46cd5
commit
eba976fec6
|
|
@ -52,7 +52,7 @@ public class BiStreamServerCallListener extends AbstractServerCallListener {
|
|||
|
||||
@Override
|
||||
public void onCancel(TriRpcStatus status) {
|
||||
responseObserver.onError(status.asException());
|
||||
requestObserver.onError(status.asException());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
package org.apache.dubbo.rpc.protocol.tri.transport;
|
||||
|
||||
import io.netty.handler.codec.http2.DefaultHttp2ResetFrame;
|
||||
import io.netty.handler.codec.http2.Http2Error;
|
||||
import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
|
||||
import org.apache.dubbo.common.logger.LoggerFactory;
|
||||
|
||||
|
|
@ -67,6 +69,17 @@ public class TripleServerConnectionHandler extends Http2ChannelDuplexHandler {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||
super.channelInactive(ctx);
|
||||
//reset all active stream on connection close
|
||||
forEachActiveStream(stream -> {
|
||||
DefaultHttp2ResetFrame resetFrame = new DefaultHttp2ResetFrame(Http2Error.NO_ERROR).stream(stream);
|
||||
ctx.fireChannelRead(resetFrame);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
private boolean isQuiteException(Throwable t) {
|
||||
if (QUIET_EXCEPTIONS_CLASS.contains(t.getClass())) {
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue