-
Type:
Bug
-
Status: Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: rpc
-
Labels:None
Code in NettyRpcServerResponseEncoder
@Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { if (msg instanceof RpcResponse) { RpcResponse resp = (RpcResponse) msg; BufferChain buf = resp.getResponse(); ctx.write(Unpooled.wrappedBuffer(buf.getBuffers()), promise).addListener(f -> { resp.done(); if (f.isSuccess()) { metrics.sentBytes(buf.size()); } }); } else { ctx.write(msg, promise); } }
If exception occurs during ChannelHandlerContext#write (such as Client disconnected), ByteBuff may not be recycled correctly.
- links to