You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/09/29 01:17:22 UTC
[GitHub] rdhabalia opened a new pull request #2676: Fix: Race condition
while initializing PatternMultiTopicsConsumer
rdhabalia opened a new pull request #2676: Fix: Race condition while initializing PatternMultiTopicsConsumer
URL: https://github.com/apache/pulsar/pull/2676
### Motivation
Saw below failure for `PatternTopicsConsumerImplTest::testStartEmptyPatternConsumer` which generally happens when `Parent-MultiTopicsConsumerImpl` completes subscribe-future before `PatternMultiTopicsConsumer` initialize constructor and initialize variables. And if client tries to access any getters before consumer-init then it gives NPE.
```
java.lang.AssertionError: expected [null] but found [persistent://my-property/my-ns/pattern-topic.*]
at org.testng.Assert.fail(Assert.java:96)
at org.testng.Assert.failNotSame(Assert.java:772)
at org.testng.Assert.assertSame(Assert.java:723)
at org.testng.Assert.assertSame(Assert.java:733)
at org.apache.pulsar.client.impl.PatternTopicsConsumerImplTest.testStartEmptyPatternConsumer(PatternTopicsConsumerImplTest.java:487)
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:124)
at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:54)
at org.testng.internal.InvokeMethodRunnable.run(InvokeMethodRunnable.java:44)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
```
### Modification
Completes subscribe-future after initializing consumer variables
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services