Pavel Tupitsyn created IGNITE-16725:
---------------------------------------

             Summary: Thin 3.0: Netty buffer leak
                 Key: IGNITE-16725
                 URL: https://issues.apache.org/jira/browse/IGNITE-16725
             Project: Ignite
          Issue Type: Bug
          Components: thin client
    Affects Versions: 3.0.0-alpha4
            Reporter: Pavel Tupitsyn
            Assignee: Pavel Tupitsyn
             Fix For: 3.0.0-alpha5


Leaked Netty buffers are detected during the test execution.
* Fix the leak
* Add failure condition on TeamCity so that the build fails when leak is 
detected

{code}
2022-03-23 10:17:53:061 +0300 
[ERROR][nioEventLoopGroup-66-14][ResourceLeakDetector] 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:
#1:
  
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:285)
  
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
  
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
  
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
  
io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
  
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
  
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
  
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
  
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
  io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
  
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
  io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
  io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
  
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
  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(Thread.java:834)
#2:
  
io.netty.buffer.AdvancedLeakAwareByteBuf.order(AdvancedLeakAwareByteBuf.java:71)
  
io.netty.handler.codec.LengthFieldBasedFrameDecoder.getUnadjustedFrameLength(LengthFieldBasedFrameDecoder.java:451)
  
io.netty.handler.codec.LengthFieldBasedFrameDecoder.decode(LengthFieldBasedFrameDecoder.java:406)
  
org.apache.ignite.internal.client.proto.ClientMessageDecoder.decode(ClientMessageDecoder.java:54)
  
io.netty.handler.codec.LengthFieldBasedFrameDecoder.decode(LengthFieldBasedFrameDecoder.java:332)
  
io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:507)
  
io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:446)
  
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
  
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
  
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
  
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
  
io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
  
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
  
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
  
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
  
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
  io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
  
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
  io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
  io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
  
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
  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(Thread.java:834)
#3:
  Hint: 'ClientMessageDecoder#0' will handle the message from this point.
  io.netty.channel.DefaultChannelPipeline.touch(DefaultChannelPipeline.java:116)
  
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
  
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
  
io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
  
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
  
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
  
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
  
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
  io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
  
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
  io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
  io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
  
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
  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(Thread.java:834)
#4:
  Hint: 'DefaultChannelPipeline$HeadContext#0' will handle the message from 
this point.
  io.netty.channel.DefaultChannelPipeline.touch(DefaultChannelPipeline.java:116)
  
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
  
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
  
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
  io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
  
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
  io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
  io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
  
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
  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(Thread.java:834)
#5:
  
io.netty.buffer.AdvancedLeakAwareByteBuf.writeBytes(AdvancedLeakAwareByteBuf.java:635)
  
io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350)
  
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
  io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
  
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
  io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
  io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
  
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
  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(Thread.java:834)
Created at:
  
io.netty.buffer.PooledByteBufAllocator.newDirectBuffer(PooledByteBufAllocator.java:402)
  
io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:188)
  
io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:179)
  
io.netty.buffer.AbstractByteBufAllocator.ioBuffer(AbstractByteBufAllocator.java:140)
  
io.netty.channel.DefaultMaxMessagesRecvByteBufAllocator$MaxMessageHandle.allocate(DefaultMaxMessagesRecvByteBufAllocator.java:120)
  
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:150)
  io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
  
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
  io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
  io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
  
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
  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(Thread.java:834)
: 3 leak records were discarded because the leak record count is targeted to 4. 
Use system property io.netty.leakDetection.targetRecords to increase the limit.
{code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to