RainYuY commented on code in PR #15594:
URL: https://github.com/apache/dubbo/pull/15594#discussion_r2242280383
##########
dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/util/NacosNamingServiceUtils.java:
##########
@@ -114,8 +115,17 @@ public static NacosNamingServiceWrapper
createNamingService(URL connectionURL) {
boolean check = connectionURL.getParameter(NACOS_CHECK_KEY, true);
int retryTimes = connectionURL.getPositiveParameter(NACOS_RETRY_KEY,
10);
int sleepMsBetweenRetries =
connectionURL.getPositiveParameter(NACOS_RETRY_WAIT_KEY, 10);
- NacosConnectionManager nacosConnectionManager =
- new NacosConnectionManager(connectionURL, check, retryTimes,
sleepMsBetweenRetries);
+ NacosConnectionManager nacosConnectionManager;
+ try {
+ nacosConnectionManager =
+ new NacosConnectionManager(connectionURL, check,
retryTimes, sleepMsBetweenRetries);
+ } catch (IllegalStateException e) {
+ if (RegistryFactory.isCheck(connectionURL)) {
+ throw e;
+ }
+ nacosConnectionManager =
+ new NacosConnectionManager(connectionURL, false,
retryTimes, sleepMsBetweenRetries);
Review Comment:
I think this change might cause some problems. This registry isn’t
functioning normally, but it's still added to the RegistryManager. As a result,
subsequent actions might use this registry, which could lead to more errors.
I'm not sure exactly what will happen after this PR is merged, but I’ll try to
reproduce the issue later.
--
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]