You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "vergilyn (GitHub)" <gi...@apache.org> on 2020/03/19 07:45:29 UTC
[GitHub] [dubbo] vergilyn commented on issue #5885: nacos v1.1.4,
dubbo v2.7.6.SNAPSHOT "No provider available from registry xxx"
> 这个应该不是empty协议的问题,因为ZookeepRergistry里也是这么做的
理解不能..😅
debug 确实是因为 dubbo 2.7.6为了兼容历史,创建了一个未被提供的 serviceName = "providers:org.apache.dubbo.samples.api.GreetingService:1.0.0"。(被正确提供的 serviceName 后面多一个 冒号)
```
// org.apache.dubbo.registry.nacos.NacosRegistry#getServiceNames0
private Set<String> getServiceNames0(URL url) {
NacosServiceName serviceName = createServiceName(url);
final Set<String> serviceNames;
if (serviceName.isConcrete()) { // is the concrete service name
serviceNames = new LinkedHashSet<>();
serviceNames.add(serviceName.toString());
/* vergilyn-question, 2020-03-18 >>>> 注释,由于"no provider available"
* https://github.com/apache/dubbo/issues/5871
* https://github.com/apache/dubbo/issues/5885
*/
// Add the legacy service name since 2.7.6
// serviceNames.add(getLegacySubscribedServiceName(url));
} else {
serviceNames = filterServiceNames(serviceName);
}
return serviceNames;
}
``
然后由于nacos确实不存在这个serviceName,其 instances == empty,刚好满足创建 empty protocol的条件。接着也满足 `integration.RegistryDirectory#refreshInvoker(...)` forbidden 的条件,所以最终并没有可用的invokers.
ps. 大佬通过 dubbo-sample 修改dubbo版本复现bug了吗?
[ Full content available at: https://github.com/apache/dubbo/issues/5885 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org