zrlw commented on code in PR #15639:
URL: https://github.com/apache/dubbo/pull/15639#discussion_r2311774782


##########
dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java:
##########
@@ -890,19 +901,18 @@ private DynamicConfiguration 
prepareEnvironment(ConfigCenterConfig configCenter)
             DynamicConfiguration dynamicConfiguration;
             try {
                 dynamicConfiguration = 
getDynamicConfiguration(configCenter.toUrl());
-            } catch (Exception e) {
-                if (!configCenter.isCheck()) {
+                if (!dynamicConfiguration.isAvailable()) {
                     logger.warn(
-                            CONFIG_FAILED_INIT_CONFIG_CENTER,
-                            "",
-                            "",
-                            "The configuration center failed to initialize",
-                            e);
-                    configCenter.setInitialized(false);
-                    return null;
-                } else {
-                    throw new IllegalStateException(e);
+                            CONFIG_FAILED_INIT_CONFIG_CENTER, "", "", "The 
configuration center failed to initialize");
+                    if (configCenter.isCheck()) {
+                        throw new IllegalStateException(
+                                "Can't create config-center client, the 
connection is not available, check fail.");
+                    } else {
+                        return dynamicConfiguration;
+                    }
                 }
+            } catch (Exception e) {

Review Comment:
   it seemed werid that throw IllegalStateException in the try-catch block, 
maybe you should catch exception before checking dynamicConfiguration.



-- 
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]

Reply via email to