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

ByteBuff may not recycle correctly when NettyRpcServer enabled and client disconnect

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: rpc
    • Labels:
      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

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

                Dates

                • Created:
                  Updated: