You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/10/12 02:45:06 UTC

[dubbo] branch 3.0 updated: set module started at applicationDeployer checkStarted() (#9013)

This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new 1dc1822  set module started at applicationDeployer checkStarted() (#9013)
1dc1822 is described below

commit 1dc18227ef82c6352cbfb6ffeabf39480410ae60
Author: zrlw <zr...@sina.com>
AuthorDate: Tue Oct 12 10:44:51 2021 +0800

    set module started at applicationDeployer checkStarted() (#9013)
---
 .../java/org/apache/dubbo/common/deploy/ApplicationDeployer.java | 2 +-
 .../apache/dubbo/config/deploy/DefaultApplicationDeployer.java   | 9 ++++++---
 .../org/apache/dubbo/config/deploy/DefaultModuleDeployer.java    | 3 +--
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/deploy/ApplicationDeployer.java b/dubbo-common/src/main/java/org/apache/dubbo/common/deploy/ApplicationDeployer.java
index 71bbcc7..0a61208 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/deploy/ApplicationDeployer.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/deploy/ApplicationDeployer.java
@@ -61,6 +61,6 @@ public interface ApplicationDeployer extends Deployer<ApplicationModel> {
 
     void checkStarting();
 
-    void checkStarted();
+    void checkStarted(CompletableFuture checkerStartFuture);
 
 }
diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java
index 0c311ae..673d997 100644
--- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java
+++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java
@@ -830,7 +830,7 @@ public class DefaultApplicationDeployer extends AbstractDeployer<ApplicationMode
     }
 
     @Override
-    public void checkStarted() {
+    public void checkStarted(CompletableFuture checkerStartFuture) {
         for (ModuleModel moduleModel : applicationModel.getModuleModels()) {
             if (moduleModel.getDeployer().isPending()) {
                 setPending();
@@ -839,7 +839,7 @@ public class DefaultApplicationDeployer extends AbstractDeployer<ApplicationMode
             }
         }
         // all modules has been started
-        onStarted();
+        onStarted(checkerStartFuture);
     }
 
     private void onStarting() {
@@ -849,7 +849,7 @@ public class DefaultApplicationDeployer extends AbstractDeployer<ApplicationMode
         }
     }
 
-    private void onStarted() {
+    private void onStarted(CompletableFuture checkerStartFuture) {
         setStarted();
         if (logger.isInfoEnabled()) {
             logger.info(getIdentifier() + " is ready.");
@@ -857,6 +857,9 @@ public class DefaultApplicationDeployer extends AbstractDeployer<ApplicationMode
         if (startFuture != null) {
             startFuture.complete(true);
         }
+        if (checkerStartFuture != null) {
+            checkerStartFuture.complete(true);
+        }
     }
 
     private void onStopping() {
diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultModuleDeployer.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultModuleDeployer.java
index a6e9b8d..c8b8bac 100644
--- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultModuleDeployer.java
+++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultModuleDeployer.java
@@ -219,8 +219,7 @@ public class DefaultModuleDeployer extends AbstractDeployer<ModuleModel> impleme
     private void onModuleStarted(CompletableFuture startFuture) {
         setStarted();
         logger.info(getIdentifier() + " has started.");
-        startFuture.complete(true);
-        applicationDeployer.checkStarted();
+        applicationDeployer.checkStarted(startFuture);
     }
 
     private void onModuleStopping() {