Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-10346

InitialClusterSizeTest thread leak

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 10.0.0.Final
    • 10.0.0.Final
    • Core, Test Suite
    • None

      I got a thread leak when running the test suite with trace logging enabled and taskset -c 1-2:

      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/:?]
      

      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().

              dberinde@redhat.com Dan Berindei (Inactive)
              dberinde@redhat.com Dan Berindei (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: