RainYuY commented on issue #15271: URL: https://github.com/apache/dubbo/issues/15271#issuecomment-3123818477
> Hi [@RainYuY](https://github.com/RainYuY) , some suggestion please. > > The reason for the issue [#15003](https://github.com/apache/dubbo/issues/15003) are as follows: > > when application starting , the registry client will create and it will check the connection status by default. if the connection status is not available, it will throw an exception `java.lang.IllegalStateException`. > > Normally the exception will be caught in `org.apache.dubbo.registry.support.AbstractRegistryFactory#getRegistry(URL url)`, but the options `registry.check` will effect its behavior, if `registry.check=false` it only print the log msg, finally the return variable `registry` is null. > > I found the following comment in `org.apache.dubbo.registry.RegistryFactory#getRegistry` > > ``` > Params: url – Registry address, is not allowed to be empty > Returns: Registry reference, never return empty value > ``` > > Perhaps we should consider fixing the issue of method `RegistryFactory#getRegistry` returning empty value, whether the registry client needs to check connection status dependency on option `registry.check`. > > the `nacos` client has option `nacos.check`, it decided whether to check connection status or not. the `zookeeper` client does not has this option, it always check the connection status. > > This is my plan: > > if the option `registry.check` is `false` > > `NacosRegisrty`: in `org.apache.dubbo.registry.nacos.util.NacosNamingServiceUtils#createNamingService` if `new NacosConnectionManager()` throw an exception, there will create a new `NacosConnectionManager` use `nacos.check=false` > > `ZookeeperRegistry`: in `org.apache.dubbo.remoting.zookeeper.curator5.Curator5ZookeeperClient#Curator5ZookeeperClient` the logic of checking connection status will only be executed when the option `registry.check` is true. or introduce new option `zk.check` and the processing logic is similar as `NacosRegistry`? You can go ahead — I think it could be a viable solution. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
