[infinispan-issues] [JBoss JIRA] (ISPN-7598) LocalDistributedExecutorTest leaks threads

Dan Berindei (JIRA) issues at jboss.org
Mon Mar 13 08:12:00 EDT 2017


    [ https://issues.jboss.org/browse/ISPN-7598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13376688#comment-13376688 ] 

Dan Berindei commented on ISPN-7598:
------------------------------------

Found more leaked threads in the test suite:

* {{SingleFileStoreStressTest}} creates some executors to run {{SingleFileStore.process()}} and never stops them.
* {{ClusteredSecureCacheTest}} and {{CacheAuthorizationTest}} don't properly shut down the cache manager because of a NPE.
* {{ParallelIteratorTest}} subclasses don't stop the executor service.
* The {{CountingCARD}} used by some functional API tests doesn't shut down its timeout executor.

The problem in {{ClusteredSecureCacheTest}} is that {{TestingUtil.killCacheManagers()}} first stops each cache individually, including the security cache, and only then calls {{DefaultCacheManager.stop()}}. {{DefaultCacheManager.terminate()}} then tries to unregister the cache MBeans from JMX, even if the cache is already stopped (because {{CacheJmxRegistration.stop()}} doesn't do that). But because the security cache is also stopped, {{unregisterCacheMBean}} throws a {{NullPointerException}}, and the cache manager doesn't shut down properly.

{noformat}
12:10:03,334 WARN  (testng-test:[]) [TestingUtil] Problems killing cache manager org.infinispan.manager.DefaultCacheManager at 54cf7c6a@Address:test-NodeB-27841
org.infinispan.IllegalLifecycleStateException: ISPN000323: ___acl_cache is in 'TERMINATED' state and so it does not accept new invocations. Either restart it or recreate the cache container.
	at org.infinispan.cache.impl.SimpleCacheImpl.getDataContainer(SimpleCacheImpl.java:1049) ~[classes/:?]
	at org.infinispan.cache.impl.SimpleCacheImpl.computeIfAbsentInternal(SimpleCacheImpl.java:1121) ~[classes/:?]
	at org.infinispan.cache.impl.StatsCollectingCache.computeIfAbsentInternal(StatsCollectingCache.java:268) ~[classes/:?]
	at org.infinispan.cache.impl.SimpleCacheImpl.computeIfAbsent(SimpleCacheImpl.java:1116) ~[classes/:?]
	at org.infinispan.cache.impl.AbstractDelegatingCache.computeIfAbsent(AbstractDelegatingCache.java:343) ~[classes/:?]
	at org.infinispan.cache.impl.TypeConverterDelegatingAdvancedCache.computeIfAbsent(TypeConverterDelegatingAdvancedCache.java:157) ~[classes/:?]
	at org.infinispan.security.impl.AuthorizationHelper.checkSubjectPermissionAndRole(AuthorizationHelper.java:107) ~[classes/:?]
	at org.infinispan.security.impl.AuthorizationHelper.checkPermission(AuthorizationHelper.java:76) ~[classes/:?]
	at org.infinispan.security.impl.AuthorizationManagerImpl.checkPermission(AuthorizationManagerImpl.java:42) ~[classes/:?]
	at org.infinispan.security.impl.SecureCacheImpl.getComponentRegistry(SecureCacheImpl.java:346) ~[classes/:?]
	at org.infinispan.manager.DefaultCacheManager.unregisterCacheMBean(DefaultCacheManager.java:739) ~[classes/:?]
	at org.infinispan.manager.DefaultCacheManager.terminate(DefaultCacheManager.java:692) ~[classes/:?]
	at org.infinispan.manager.DefaultCacheManager.stopCaches(DefaultCacheManager.java:733) ~[classes/:?]
	at org.infinispan.manager.DefaultCacheManager.stop(DefaultCacheManager.java:713) ~[classes/:?]
	at org.infinispan.test.TestingUtil.killCacheManagers(TestingUtil.java:656) [test-classes/:?]
	at org.infinispan.test.TestingUtil.killCacheManagers(TestingUtil.java:639) [test-classes/:?]
	at org.infinispan.test.TestingUtil.killCacheManagers(TestingUtil.java:635) [test-classes/:?]
	at org.infinispan.test.MultipleCacheManagersTest.destroy(MultipleCacheManagersTest.java:125) [test-classes/:?]
	at org.infinispan.security.ClusteredSecureCacheTest.access$201(ClusteredSecureCacheTest.java:22) [test-classes/:?]
	at org.infinispan.security.ClusteredSecureCacheTest$2.run(ClusteredSecureCacheTest.java:52) [test-classes/:?]
	at org.infinispan.security.ClusteredSecureCacheTest$2.run(ClusteredSecureCacheTest.java:49) [test-classes/:?]
	at org.infinispan.security.Security.doAs(Security.java:118) [classes/:?]
	at org.infinispan.security.ClusteredSecureCacheTest.destroy(ClusteredSecureCacheTest.java:49) [test-classes/:?]
{noformat}

> LocalDistributedExecutorTest leaks threads
> ------------------------------------------
>
>                 Key: ISPN-7598
>                 URL: https://issues.jboss.org/browse/ISPN-7598
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Test Suite - Core
>    Affects Versions: 9.0.0.CR2
>            Reporter: Dan Berindei
>            Assignee: Dan Berindei
>              Labels: testsuite_stability
>             Fix For: 9.0.0.Final
>
>
> Each test method creates a new {{DefaultExecutorService}} instance, and each instance uses a new local executor created with {{Executors.newCachedThreadPool(...)}}. But the {{DefaultExecutorService}} is created with {{takeExecutorOwnership = false}}, and so the local executor is not stopped on shutdown.



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the infinispan-issues mailing list