Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
Correctness - Test Failure
-
Low
-
Normal
-
Unit Test
-
All
-
None
-
Description
Reference-Reaper detected leak while running FramingTest unit test cases. Here are the leak details:
[junit-timeout] ERROR [Reference-Reaper] 2019-06-17 01:44:53,812 Ref.java:228 - LEAK DETECTED: a reference (org.apache.cassandra.utils.concurrent.Ref$State@15460327) to @876994034 was not released before the reference was garbage collected [junit-timeout] ERROR [Reference-Reaper] 2019-06-17 01:44:53,812 Ref.java:259 - Allocate trace org.apache.cassandra.utils.concurrent.Ref$State@15460327: [junit-timeout] Thread[main,5,main] [junit-timeout] at java.lang.Thread.getStackTrace(Thread.java:1559) [junit-timeout] at org.apache.cassandra.utils.concurrent.Ref$Debug.<init>(Ref.java:249) [junit-timeout] at org.apache.cassandra.utils.concurrent.Ref$State.<init>(Ref.java:179) [junit-timeout] at org.apache.cassandra.utils.concurrent.Ref.<init>(Ref.java:101) [junit-timeout] at org.apache.cassandra.utils.memory.BufferPool$Chunk.setAttachment(BufferPool.java:960) [junit-timeout] at org.apache.cassandra.utils.memory.BufferPool$Chunk.set(BufferPool.java:1100) [junit-timeout] at org.apache.cassandra.utils.memory.BufferPool$Chunk.get(BufferPool.java:1090) [junit-timeout] at org.apache.cassandra.utils.memory.BufferPool$LocalPool.tryGetInternal(BufferPool.java:721) [junit-timeout] at org.apache.cassandra.utils.memory.BufferPool$LocalPool.tryGet(BufferPool.java:706) [junit-timeout] at org.apache.cassandra.utils.memory.BufferPool$LocalPool.get(BufferPool.java:656) [junit-timeout] at org.apache.cassandra.utils.memory.BufferPool$LocalPool.access$000(BufferPool.java:535) [junit-timeout] at org.apache.cassandra.utils.memory.BufferPool.getAtLeast(BufferPool.java:129) [junit-timeout] at org.apache.cassandra.net.FramingTest.sequenceOfMessages(FramingTest.java:413) [junit-timeout] at org.apache.cassandra.net.FramingTest.testRandomSequenceOfMessages(FramingTest.java:265) [junit-timeout] at org.apache.cassandra.net.FramingTest.testSomeMessages(FramingTest.java:259) [junit-timeout] at org.apache.cassandra.net.FramingTest.testRandomLegacy(FramingTest.java:243) [junit-timeout] at org.apache.cassandra.net.FramingTest.testRandomLegacy(FramingTest.java:234) [junit-timeout] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [junit-timeout] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [junit-timeout] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [junit-timeout] at java.lang.reflect.Method.invoke(Method.java:498) [junit-timeout] at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) [junit-timeout] at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-timeout] at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) [junit-timeout] at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-timeout] at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) [junit-timeout] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) [junit-timeout] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) [junit-timeout] at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) [junit-timeout] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) [junit-timeout] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) [junit-timeout] at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) [junit-timeout] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) [junit-timeout] at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) [junit-timeout] at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) [junit-timeout] at org.junit.runners.ParentRunner.run(ParentRunner.java:363) [junit-timeout] at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:38) [junit-timeout] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:534) [junit-timeout] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1196) [junit-timeout] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:1041)
“sliceAndConsume" method of ShareableBytes increases reference count. Reference acquired testRandomSequenceOfMessages method is not released which is causing the leak.