LEAK : ByteBuf.release was not called

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Unknown
    • 5.6.0
    • Affects Version/s: None
    • Component/s: Wire Protocol
    • None
    • Fully Compatible
    • Java Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      under mongo-java-driver : 5.5.1, netty : 4.1.122-FINAL, jdk24 + ZGC
      i can see such an error like below from time to time.
      as i see, i can be timing issue.
      for normal state, ByteBuf is read completely -> released -> GC collects
      however, sometimes ByteBuf is read completely -> GC collects > released : this is ERROR!
      can i get any suggestion or advice?

      related linkl

      
      LEAK: ByteBuf.release() was not called before it's garbage-collected. See https://netty.io/wiki/reference-counted-objects.html for more information.
      Recent access records: 
      Created at:
          io.netty.buffer.AbstractByteBufAllocator.compositeDirectBuffer(AbstractByteBufAllocator.java:224)
          io.netty.buffer.AbstractByteBufAllocator.compositeBuffer(AbstractByteBufAllocator.java:202)
          com.mongodb.internal.connection.netty.NettyStream.readAsync(NettyStream.java:301)
          com.mongodb.internal.connection.netty.NettyStream.handleReadResponse(NettyStream.java:361)
          com.mongodb.internal.connection.netty.NettyStream.access$900(NettyStream.java:115)
          com.mongodb.internal.connection.netty.NettyStream$InboundBufferHandler.channelRead0(NettyStream.java:437)
          com.mongodb.internal.connection.netty.NettyStream$InboundBufferHandler.channelRead0(NettyStream.java:434)
          io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
          io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
          io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
          io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
          io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1357)
          io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
          io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
          io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:868)
          io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
          io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:796)
          io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:732)
          io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:658)
          io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
          io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:998)
          io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
          io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
          java.base/java.lang.Thread.run(Unknown Source)
      
      

            Assignee:
            Ross Lawley
            Reporter:
            cedric lee
            Slav Babanin
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: