[Bug] Registry check does not work in the case of multiple registrations and subscriptions at the application level, and provider export error causes Dubbo to fail to start
Pre-check
- [X] I am sure that all the content I provide is in English.
Search before asking
- [X] I had searched in the issues and found no similar issues.
Apache Dubbo Component
Java SDK (apache/dubbo)
Dubbo Version
dubbo3.2.16; jdk openjdk21
Steps to reproduce this issue
Dubbo3.2.16 uses two Nacos clusters as registration centers to implement application level multi subscription and multi subscription, and configure regirty.check=false. When one of the Nacos clusters is unavailable, dubbo serviceConfig. export reports an error causing startup failure, with the error message 'this.registry is null'
What you expected to happen
When a Nacos cluster is unavailable, it should be possible to export services normally on another Nacos cluster and ignore the other Nacos cluster
Anything else
No response
Are you willing to submit a pull request to fix on your own?
- [x] Yes I am willing to submit a pull request on my own!
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Can you show the complete error message?
ServiceConfig#doExportUrl -> RegistryProtocol#export方法中,this.getRegistry(registryUrl)获得的Registry 是null,后面的逻辑没有判断这个值是否null,在RegistryProtocol#register方法中报空指针异常
其他场景也有类似的问题,有的场景会判断Registry是否为null,而正常结束; 有的就类似现在启动export时报空指针异常
我这个是多注册中心的高可用场景,如果多注册支持高可用的话,这里循环其中一个注册中心不应该异常退出
配置如图
是的,我查看了这个问题,并确定它是存在的。我们应该提交一个合并请求来修复它。 @AlbumenJ
大佬 有计划什么时候修复吗 @AlbumenJ @walkinggo
Add a configuration like checkThreshold in MultipleRegistry may works. Are there anyone want to contribute?
大佬 帮看下我们的诉求是否和你们的设计初衷一样,我们的诉求是:在多注册中心下,如果全部注册中心或者部分注册中心可用,则export成功且启动成功,如果全部注册中心不可用,则异常结束让开发人员感知到
@huangqy17 If you don't want to receive the NPE, you can add this config: dubbo.registries.${id}.parameters=[{nacos.check:false}]