zrlw commented on a change in pull request #9015:
URL: https://github.com/apache/dubbo/pull/9015#discussion_r734919912



##########
File path: 
dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java
##########
@@ -512,22 +513,23 @@ private void initMetadataService() {
      * @return
      */
     @Override
+    @SuppressWarnings("rawtypes")
     public synchronized Future start() {
-        CompletableFuture startFuture = getStartFuture();
-
-        // maybe call start again after add new module, check if any new module
-        boolean hasPendingModule = hasPendingModule();
-
         if (isStarting()) {
-            // currently is starting, maybe both start by module and 
application
-            // if has new modules, start them
-            if (hasPendingModule) {
-                startModules();
-            }
+            // currently is starting.
+            // maybe first start ModuleDeployer then start DubboBootstrap,
+            // so initialize() and doStart() should support idempotent calling 
+            // because we don't know whether they have been called or not.
+            // see 
DubboBootstrapMultiInstanceTest#testBothStartByModuleAndByApplication
+            initialize();
+            doStart();

Review comment:
       you are right, i see DefaultModuleDeployer calls  
applicationDeployer.initialize() and prepareApplicationInstance.
   but you might keep the running condition of prepareApplicationInstance 
execution same with DefaultModuleDeployer that checks both 
isRegisterConsumerInstance() and hasExportedServices().
   




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