You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2023/12/01 12:14:00 UTC
[I] [Bug] ClassCastException in ExtensibleLoadManagerImpl.checkOwnershipAsync [pulsar]
lhotari opened a new issue, #21654:
URL: https://github.com/apache/pulsar/issues/21654
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
### Example failures
- [2023-11-26T06:33:53.3405489Z](https://github.com/apache/pulsar/actions/runs/6993786233/job/19026941485#step:11:1122)
### Exception stacktrace
```
org.apache.pulsar.client.admin.PulsarAdminException$ServerSideErrorException:
--- An unexpected error occurred in the server ---
Message: class java.util.ImmutableCollections$List12 cannot be cast to class java.util.concurrent.CompletableFuture (java.util.ImmutableCollections$List12 and java.util.concurrent.CompletableFuture are in module java.base of loader 'bootstrap')
Stacktrace:
java.lang.ClassCastException: class java.util.ImmutableCollections$List12 cannot be cast to class java.util.concurrent.CompletableFuture (java.util.ImmutableCollections$List12 and java.util.concurrent.CompletableFuture are in module java.base of loader 'bootstrap')
at org.apache.pulsar.broker.loadbalance.extensions.ExtensibleLoadManagerImpl.checkOwnershipAsync(ExtensibleLoadManagerImpl.java:625)
at org.apache.pulsar.broker.loadbalance.extensions.ExtensibleLoadManagerWrapper.checkOwnershipAsync(ExtensibleLoadManagerWrapper.java:72)
at org.apache.pulsar.broker.namespace.NamespaceService.lambda$checkTopicOwnership$47(NamespaceService.java:1230)
at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187)
at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2341)
at org.apache.pulsar.broker.namespace.NamespaceService.checkTopicOwnership(NamespaceService.java:1230)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
at org.mockito.internal.util.reflection.InstrumentationMemberAccessor$Dispatcher$ByteBuddy$sc8ugsJW.invokeWithArguments(Unknown Source)
at org.mockito.internal.util.reflection.InstrumentationMemberAccessor.invoke(InstrumentationMemberAccessor.java:251)
at org.mockito.internal.util.reflection.ModuleMemberAccessor.invoke(ModuleMemberAccessor.java:55)
at org.mockito.internal.creation.bytebuddy.MockMethodAdvice.tryInvoke(MockMethodAdvice.java:314)
at org.mockito.internal.creation.bytebuddy.MockMethodAdvice$RealMethodCall.invoke(MockMethodAdvice.java:234)
at org.mockito.internal.invocation.InterceptedInvocation.callRealMethod(InterceptedInvocation.java:142)
at org.mockito.internal.stubbing.answers.CallsRealMethods.answer(CallsRealMethods.java:45)
at org.mockito.Answers.answer(Answers.java:90)
at org.mockito.internal.handler.MockHandlerImpl.handle(MockHandlerImpl.java:111)
at org.mockito.internal.handler.NullResultGuardian.handle(NullResultGuardian.java:29)
at org.mockito.internal.handler.InvocationNotifierHandler.handle(InvocationNotifierHandler.java:34)
at org.mockito.internal.creation.bytebuddy.MockMethodInterceptor.doIntercept(MockMethodInterceptor.java:82)
at org.mockito.internal.creation.bytebuddy.MockMethodAdvice.handle(MockMethodAdvice.java:134)
at org.apache.pulsar.broker.namespace.NamespaceService.checkTopicOwnership(NamespaceService.java:1228)
at org.apache.pulsar.broker.service.BrokerService.checkTopicNsOwnership(BrokerService.java:2221)
at org.apache.pulsar.broker.service.BrokerService.loadOrCreatePersistentTopic(BrokerService.java:1562)
at org.apache.pulsar.broker.service.BrokerService.lambda$getTopic$30(BrokerService.java:1086)
at org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap$Section.put(ConcurrentOpenHashMap.java:438)
at org.apache.pulsar.common.util.collections.ConcurrentOpenHashMap.computeIfAbsent(ConcurrentOpenHashMap.java:257)
at org.apache.pulsar.broker.service.BrokerService.lambda$getTopic$32(BrokerService.java:1067)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] ClassCastException in ExtensibleLoadManagerImpl.checkOwnershipAsync [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #21654:
URL: https://github.com/apache/pulsar/issues/21654#issuecomment-1836029813
Location of the ClassCastException
```
java.util.concurrent.CompletionException: java.lang.ClassCastException: class java.util.ImmutableCollections$List12 cannot be cast to class java.util.concurrent.CompletableFuture (java.util.ImmutableCollections$List12 and java.util.concurrent.CompletableFuture are in module java.base of loader 'bootstrap')
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:332) ~[?:?]
at java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1177) ~[?:?]
at java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2341) ~[?:?]
at org.apache.pulsar.broker.service.BrokerService.lambda$getTopic$32(BrokerService.java:1087) ~[classes/:?]
at java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187) ~[?:?]
at java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2341) ~[?:?]
at org.apache.pulsar.broker.service.BrokerService.getTopic(BrokerService.java:1065) ~[classes/:?]
at org.apache.pulsar.broker.service.BrokerService.getTopic(BrokerService.java:1022) ~[classes/:?]
at org.apache.pulsar.broker.service.BrokerService.getTopic(BrokerService.java:1017) ~[classes/:?]
at org.apache.pulsar.broker.service.ServerCnx.lambda$handleSubscribe$14(ServerCnx.java:1220) ~[classes/:?]
at java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187) ~[?:?]
at java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2341) ~[?:?]
at org.apache.pulsar.broker.service.ServerCnx.lambda$handleSubscribe$20(ServerCnx.java:1219) ~[classes/:?]
at java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:684) ~[?:?]
at java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:662) ~[?:?]
at java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2200) ~[?:?]
at org.apache.pulsar.broker.service.ServerCnx.handleSubscribe(ServerCnx.java:1170) ~[classes/:?]
at org.apache.pulsar.common.protocol.PulsarDecoder.channelRead(PulsarDecoder.java:243) ~[pulsar-common-3.2.0-SNAPSHOT.jar:3.2.0-SNAPSHOT]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Flaky-test: ClassCastException in ExtensibleLoadManagerImpl.checkOwnershipAsync [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #21654:
URL: https://github.com/apache/pulsar/issues/21654#issuecomment-1836044840
This might be an issue with Mockito. Mockito isn't threadsafe in all possible ways. It's documented here how Mockito should be used: https://github.com/mockito/mockito/wiki/FAQ#is-mockito-thread-safe . Previously we have had issues #13620 and #13570 .
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Flaky-test: ClassCastException in ExtensibleLoadManagerImpl.checkOwnershipAsync [pulsar]
Posted by "heesung-sn (via GitHub)" <gi...@apache.org>.
heesung-sn commented on issue #21654:
URL: https://github.com/apache/pulsar/issues/21654#issuecomment-1836693443
Hi, I will check this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] ClassCastException in ExtensibleLoadManagerImpl.checkOwnershipAsync [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #21654:
URL: https://github.com/apache/pulsar/issues/21654#issuecomment-1836024899
@heesung-sn @Demogorgon314 would you mind checking this exception?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Flaky-test: ClassCastException in ExtensibleLoadManagerImpl.checkOwnershipAsync [pulsar]
Posted by "codelipenghui (via GitHub)" <gi...@apache.org>.
codelipenghui closed issue #21654: Flaky-test: ClassCastException in ExtensibleLoadManagerImpl.checkOwnershipAsync
URL: https://github.com/apache/pulsar/issues/21654
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Flaky-test: ClassCastException in ExtensibleLoadManagerImpl.checkOwnershipAsync [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #21654:
URL: https://github.com/apache/pulsar/issues/21654#issuecomment-1836048701
ExtensibleLoadManagerImplTest also uses org.mockito.MockedStatic . The javadoc of that says "The mocking only affects the thread on which this static mock was created and it is not safe to use this object from another thread.".
It would be better to get rid of mocking of static methods since it won't be thread safe
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Flaky-test: ClassCastException in ExtensibleLoadManagerImpl.checkOwnershipAsync [pulsar]
Posted by "heesung-sn (via GitHub)" <gi...@apache.org>.
heesung-sn commented on issue #21654:
URL: https://github.com/apache/pulsar/issues/21654#issuecomment-1839921662
Raised a PR to remove the static mock. https://github.com/apache/pulsar/pull/21668
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org