You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by ts...@apache.org on 2020/03/01 15:49:32 UTC

[dubbo] branch master updated: [Dubbo-5813]prevent destroyAll method of DubboShutdownHook being invoked twice when using Spring (#5814)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 5194791  [Dubbo-5813]prevent destroyAll method of DubboShutdownHook being invoked twice when using Spring (#5814)
5194791 is described below

commit 5194791f130eb34d6ed75bc43ef731289a12148a
Author: tswstarplanet <ts...@apache.org>
AuthorDate: Sun Mar 1 23:49:05 2020 +0800

    [Dubbo-5813]prevent destroyAll method of DubboShutdownHook being invoked twice when using Spring (#5814)
    
    * fix issue 5813, prevent destroyAll method of DubboShutdownHook being invoke twice when using Spring
    
    * fix issue 5813
---
 .../main/java/org/apache/dubbo/config/bootstrap/DubboBootstrap.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/bootstrap/DubboBootstrap.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/bootstrap/DubboBootstrap.java
index 7d1fb5e..4c6662a 100644
--- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/bootstrap/DubboBootstrap.java
+++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/bootstrap/DubboBootstrap.java
@@ -1033,11 +1033,12 @@ public class DubboBootstrap extends GenericEventListener {
     }
 
     public void destroy() {
-        // for compatibility purpose
-        DubboShutdownHook.destroyAll();
 
         if (started.compareAndSet(true, false)
                 && destroyed.compareAndSet(false, true)) {
+            // for compatibility purpose
+            DubboShutdownHook.destroyAll();
+
             unregisterServiceInstance();
             unexportMetadataService();
             unexportServices();