]
Will Burns updated ISPN-10346:
------------------------------
Status: Resolved (was: Pull Request Sent)
Resolution: Done
InitialClusterSizeTest thread leak
----------------------------------
Key: ISPN-10346
URL:
https://issues.jboss.org/browse/ISPN-10346
Project: Infinispan
Issue Type: Bug
Components: Core, Test Suite - Core
Affects Versions: 10.0.0.Beta3
Reporter: Dan Berindei
Assignee: Dan Berindei
Priority: Major
Fix For: 10.0.0.Beta4
I got a thread leak when running the test suite with trace logging enabled and {{taskset
-c 1-2}}:
{noformat}
17:06:05,307 DEBUG (testng-Test:[]) [TestSuiteProgress] Test configuration finished:
org.infinispan.remoting.transport.InitialClusterSizeTest.testClassFinished
17:15:17,284 ERROR [TestSuiteProgress] Test failed:
InitialClusterSizeTest.ThreadLeakChecker
java.lang.RuntimeException: Leaked thread
Controller-remote-thread-InitialClusterSizeTest-NodeB
at jdk.internal.misc.Unsafe.park(Native Method) ~[?:?]
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:194) ~[?:?]
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:885)
~[?:?]
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1039)
~[?:?]
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1345)
~[?:?]
at java.util.concurrent.Semaphore.acquire(Semaphore.java:318) ~[?:?]
at
org.infinispan.util.concurrent.BlockingTaskAwareExecutorServiceImpl$ControllerThread.run(BlockingTaskAwareExecutorServiceImpl.java:159)
~[classes/:?]
{noformat}
I believe it may be caused by {{doExecute()}} adding a task to the blocked tasks queue
without calling {{checkForReadyTasks()}} (after the executor rejected the task).
{{ControllerThread.run()}} needs a semaphore permit to start polling for tasks, so it
needs a {{semaphore.release()}} after each {{blockedTasks.add().