apache / apache/dubbo

No such extension org.apache.dubbo.rpc.cluster.LoadBalance by name random

Open
#5,829 16 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

- [x] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
- [x] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 2.7.3
* Operating System version: Linux version 3.10.0-957.27.2.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) )
* Java version: openjdk 11.0.2

### Steps to reproduce this issue
1.
```
@Reference
private UserService userService;
@GetMapping("/v1/user/relation/trace/test2")
public CompletableFuture dubbo2Test() {
return CompletableFuture.supplyAsync(() -> {
return userService.getUserInfo("sam");
}).thenApply(userInfo -> "s");
}
```
2. dubbo config:
it's very simple:
```
dubbo.registry.address=xxx
dubbo.reference.check=false
```

3. visit /v1/user/relation/trace/test2

### Expected Result

"s"

### Actual Result
```
2020-03-05 11:28:30.196 [ForkJoinPool.commonPool-worker-3] ERROR esa.restlight.core.bootstrap.DefaultDispatcherHandler - Error occurred when doing request(url=/v1/user/relation/trace/test2, method =GET)
java.util.concurrent.CompletionException: java.lang.IllegalStateException: No such extension org.apache.dubbo.rpc.cluster.LoadBalance by name random
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1702)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Caused by: java.lang.IllegalStateException: No such extension org.apache.dubbo.rpc.cluster.LoadBalance by name random
at org.apache.dubbo.common.extension.ExtensionLoader.findException(ExtensionLoader.java:520)
at org.apache.dubbo.common.extension.ExtensionLoader.createExtension(ExtensionLoader.java:527)
at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:351)
at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.initLoadBalance(AbstractClusterInvoker.java:296)
at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:246)
at org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:78)
at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:55)
at org.apache.dubbo.common.bytecode.proxy0.getUserInfo(proxy0.java)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.invoke(ReferenceAnnotationBeanPostProcessor.java:260)
at com.sun.proxy.$Proxy72.getUserInfo(Unknown Source)
at com.heytap.ugc.user.relation.rest.controller.TestController.lambda$dubbo2Test$34(TestController.java:182)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
... 6 common frames omitted
```

point: only when ForkJoinPool.commonPool thread call userService.getUserInfo can reproduce this issue

Contributor guide

Open the contributing guide

Research direction

Start with org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.initLoadBalance and the ExtensionLoader stack frames shown in the report. Reproduce the failure by calling userService.getUserInfo from a ForkJoinPool.commonPool thread with Dubbo 2.7.3, then determine why the random LoadBalance extension is unavailable there. Done means the request returns "s" without the reported exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design, distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.