Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-23699

ByteBuff may not recycle correctly when NettyRpcServer enabled and client disconnect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • rpc
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              javaman_chen chenxu
              javaman_chen chenxu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: