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

ClusterTopologyManagerImplTest thread leak

    XMLWordPrintable

Details

    Description

      ClusterTopologyManagerImplTest creates a "mock" GlobalComponentRegistry that's actually a regular GlobalComponentRegistry with many components replaced, avoiding the need to stop the GlobalComponentRegistry.

      In practice, when ClusterTopologyManagerImpl started using TIMEOUT_SCHEDULE_EXECUTOR, the ClusterTopologyManagerImplTest did not add a mock for it, so now the executor is not stopped.

            org.infinispan.commons.test.ThreadLeakChecker$LeakException: Leaked thread: timeout-thread--p32-t1 << testng-ClusterTopologyManagerImplTest << org.infinispan.topology.ClusterTopologyManagerImplTest
      	at java.base@11.0.9.1/jdk.internal.misc.Unsafe.$$BlockHound$$_park(Native Method)
      	at java.base@11.0.9.1/jdk.internal.misc.Unsafe.park(Unsafe.java)
      	at java.base@11.0.9.1/java.util.concurrent.locks.LockSupport.park(LockSupport.java:194)
      	at java.base@11.0.9.1/java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2081)
      	at java.base@11.0.9.1/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1170)
      	at java.base@11.0.9.1/java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:899)
      	at java.base@11.0.9.1/java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1054)
      	at java.base@11.0.9.1/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1114)
      	at java.base@11.0.9.1/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at java.base@11.0.9.1/java.lang.Thread.run(Thread.java:834)
      Caused by: org.infinispan.commons.test.ThreadLeakChecker$LeakException: testng-ClusterTopologyManagerImplTest << org.infinispan.topology.ClusterTopologyManagerImplTest
      	at org.infinispan.commons.test.ThreadLeakChecker$ThreadInfoLocal.childValue(ThreadLeakChecker.java:111)
      	at org.infinispan.commons.test.ThreadLeakChecker$ThreadInfoLocal.childValue(ThreadLeakChecker.java:108)
      	at java.base/java.lang.ThreadLocal$ThreadLocalMap.<init>(ThreadLocal.java:411)
      	at java.base/java.lang.ThreadLocal.createInheritedMap(ThreadLocal.java:276)
      	at java.base/java.lang.Thread.<init>(Thread.java:450)
      	at java.base/java.lang.Thread.<init>(Thread.java:709)
      	at java.base/java.lang.Thread.<init>(Thread.java:530)
      	at org.infinispan.commons.jdkspecific.ThreadCreator.createThread(ThreadCreator.java:9)
      	at org.infinispan.factories.threads.DefaultThreadFactory.actualThreadCreate(DefaultThreadFactory.java:113)
      	at org.infinispan.factories.threads.DefaultThreadFactory.createThread(DefaultThreadFactory.java:105)
      	at org.infinispan.factories.threads.DefaultThreadFactory.newThread(DefaultThreadFactory.java:99)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.<init>(ThreadPoolExecutor.java:623)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:912)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.ensurePrestart(ThreadPoolExecutor.java:1583)
      	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:346)
      	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor.schedule(ScheduledThreadPoolExecutor.java:579)
      	at org.infinispan.executors.LazyInitializingScheduledExecutorService.schedule(LazyInitializingScheduledExecutorService.java:151)
      	at org.infinispan.util.concurrent.ConditionFuture.newConditionStage(ConditionFuture.java:52)
      	at org.infinispan.topology.ClusterTopologyManagerImpl.handleJoin(ClusterTopologyManagerImpl.java:218)
      	at org.infinispan.topology.ClusterTopologyManagerImplTest.testClusterStartupWith2Nodes(ClusterTopologyManagerImplTest.java:110)
      Caused by: org.infinispan.commons.test.ThreadLeakChecker$LeakException: org.infinispan.topology.ClusterTopologyManagerImplTest
      

      Attachments

        Activity

          People

            dberinde@redhat.com Dan Berindei (Inactive)
            dberinde@redhat.com Dan Berindei (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: