Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent test failure: OwnershipCacheTest.testGetOwner #404

Closed
rdhabalia opened this issue May 13, 2017 · 2 comments
Closed

Intermittent test failure: OwnershipCacheTest.testGetOwner #404

rdhabalia opened this issue May 13, 2017 · 2 comments
Assignees

Comments

@rdhabalia
Copy link
Contributor

OwnershipCacheTest.testGetOwner:164 » Execution org.apache.zookeeper.KeeperExc...

Test Failed - com.yahoo.pulsar.broker.namespace.OwnershipCacheTest / testGetOwner -- attrs: []

java.util.concurrent.ExecutionException: org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists

	at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)

	at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)

	at com.yahoo.pulsar.broker.namespace.OwnershipCacheTest.testGetOwner(OwnershipCacheTest.java:164)

	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

	at java.lang.reflect.Method.invoke(Method.java:498)

	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)

	at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)

	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)

	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)

	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)

	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)

	at org.testng.TestRunner.privateRun(TestRunner.java:767)

	at org.testng.TestRunner.run(TestRunner.java:617)

	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)

	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)

	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)

	at org.testng.SuiteRunner.run(SuiteRunner.java:240)

	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)

	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)

	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)

	at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)

	at org.testng.TestNG.run(TestNG.java:1057)

	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:132)

	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:193)

	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:94)

	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:147)

	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)

	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)

	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)

Caused by: org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists

	at org.apache.zookeeper.KeeperException.create(KeeperException.java:119)

	at org.apache.zookeeper.KeeperException.create(KeeperException.java:73)

	at com.yahoo.pulsar.broker.namespace.OwnershipCache$OwnedServiceUnitCacheLoader.lambda$asyncLoad$0(OwnershipCache.java:138)

	at org.apache.bookkeeper.util.ZkUtils$1.processResult(ZkUtils.java:79)

	at org.apache.zookeeper.MockZooKeeper.lambda$create$3(MockZooKeeper.java:182)

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

	at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)

	at java.lang.Thread.run(Thread.java:745)
@merlimat
Copy link
Contributor

Still happening

https://builds.apache.org/job/pulsar-pull-request/org.apache.pulsar$pulsar-broker/148/testReport/junit/org.apache.pulsar.broker.namespace/OwnershipCacheTest/testGetOwner/

Stacktrace

java.util.concurrent.ExecutionException: org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists
	at org.apache.pulsar.broker.namespace.OwnershipCacheTest.testGetOwner(OwnershipCacheTest.java:172)
Caused by: org.apache.zookeeper.KeeperException$NodeExistsException: KeeperErrorCode = NodeExists
``

@sijie
Copy link
Member

sijie commented Apr 25, 2018

This is fixed by #503

@sijie sijie closed this as completed Apr 25, 2018
hrsakai pushed a commit to hrsakai/pulsar that referenced this issue Dec 10, 2020
…ache#404)

Co-authored-by: Pavel Agaletskiy <psagaletskiy@avito.ru>
hangc0276 added a commit to hangc0276/pulsar that referenced this issue May 26, 2021
Fix apache#252 

### Motivation
When bundle unload triggered, the `consumerTopicManagers` cache won't be evicted and it will return the old `KafkaTopicConsumerManager` instance in the next fetch request handle. However, after bundle unload, the producer/consumer/managedLedger of topics in related bundle will be closed. If we use old  `KafkaTopicConsumerManager` instance to read messages, it will return `managedLedger has been closed` exception.

### Changes
1. Change `consumerTopicManagers`, `topics`, `references` map to static attribute ConcurrentHashMap.
2. Evict related cache information for topics whose bundle trigged unload.
3. Turn on `DistributedClusterTest `.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants