-
Notifications
You must be signed in to change notification settings - Fork 26.5k
Description
Pre-check
- I am sure that all the content I provide is in English.
Search before asking
- I had searched in the issues and found no similar issues.
Apache Dubbo Component
Java SDK (apache/dubbo)
Dubbo Version
Dubbo version: 3.3.6 (issue also exists in 3.2.5+)
Steps to reproduce this issue
We have a Dubbo service that subscribes to multiple ZooKeeper registries. One of them is a weakly dependent ZooKeeper (not critical for our service). We expect the service to start successfully even if this weakly dependent ZooKeeper is down.
However, in Dubbo 3.3.6, the service fails to start when the weakly dependent ZooKeeper is unavailable. We tested and found that:
Dubbo 3.2.0 ~ 3.2.4: ✅ Starts successfully (as expected)
Dubbo 3.2.5 and later: ❌ Startup fails
Steps to Reproduce:
Configure a Dubbo service with multiple ZooKeeper registries
Mark one ZooKeeper as weakly dependent (with check=false)
Shut down the weakly dependent ZooKeeper
Start the Dubbo service
What you expected to happen
The service should start successfully, ignoring the unavailable weakly dependent ZooKeeper.
Anything else
Configuration Example:
<dubbo:registry id="registry_zk" protocol="zookeeper" address="127.0.0.1:2181" check="false" use-as-metadata-center="false" use-as-config-center="false"/>
<dubbo:reference registry="registry_zk" id="someId" interface="com.SomeService" version="1.0.0" check="false"/>
Error Log:
java.lang.NullPointerException: Cannot invoke "org.apache.dubbo.registry.Registry.getUrl()" because "this.registry" is null
at org.apache.dubbo.registry.ListenerRegistryWrapper.getUrl(ListenerRegistryWrapper.java:44)
at org.apache.dubbo.registry.integration.RegistryDirectory.subscribe(RegistryDirectory.java:147)
at org.apache.dubbo.registry.integration.RegistryProtocol.doCreateInvoker(RegistryProtocol.java:667)
at org.apache.dubbo.registry.integration.InterfaceCompatibleRegistryProtocol.getInvoker(InterfaceCompatibleRegistryProtocol.java:58)
at org.apache.dubbo.registry.client.migration.MigrationInvoker.refreshInterfaceInvoker(MigrationInvoker.java:482)
at org.apache.dubbo.registry.client.migration.MigrationInvoker.migrateToApplicationFirstInvoker(MigrationInvoker.java:255)
at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.refreshInvoker(MigrationRuleHandler.java:90)
at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.doMigrate(MigrationRuleHandler.java:71)
at org.apache.dubbo.registry.client.migration.MigrationRuleListener.onRefer(MigrationRuleListener.java:285)
at org.apache.dubbo.registry.integration.RegistryProtocol.interceptInvoker(RegistryProtocol.java:630)
at org.apache.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:594)
at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:575)
at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:83)
at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.refer(ProtocolSecurityWrapper.java:112)
at org.apache.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:85)
at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:69)
at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.refer(ProtocolSerializationWrapper.java:55)
at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.refer(InvokerCountWrapper.java:48)
at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java)
at org.apache.dubbo.config.ReferenceConfig.createInvoker(ReferenceConfig.java:672)
at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:502)
at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:383)
at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:244)
at org.apache.dubbo.config.ReferenceConfigBase.get(ReferenceConfigBase.java:399)
at org.apache.dubbo.config.utils.SimpleReferenceCache.destroyReference(SimpleReferenceCache.java:294)
at org.apache.dubbo.config.utils.SimpleReferenceCache.destroy(SimpleReferenceCache.java:248)
at org.apache.dubbo.config.utils.SimpleReferenceCache.destroy(SimpleReferenceCache.java:271)
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.lambda$referServices$6(DefaultModuleDeployer.java:577)
at java.base/java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4783)
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.referServices(DefaultModuleDeployer.java:539)
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:186)
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:159)
at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:167)
at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:153)
at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:52)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:178)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:171)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:430)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:387)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:952)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:594)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:409)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)
Do you have a (mini) reproduction demo?
- Yes, I have a minimal reproduction demo to help resolve this issue more effectively!
Are you willing to submit a pull request to fix on your own?
- Yes I am willing to submit a pull request on my own!
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
Type
Projects
Status