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



##########
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:
       i debuged 
DubboBootstrapMultiInstanceTest#testBothStartByModuleAndByApplication and found 
providerBootstrap.start() just calls startModules() because the state of 
default application deployer is set to starting by 
moduleDeployer1.start().get() calling onStarting(), so initiailzie() and 
doStart() in DefaultApplicationDeployer# are not called anymore and it might 
cause problems.
   




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