Skip to content

Commit 5194791

Browse files
[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
1 parent cd55cd7 commit 5194791

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/bootstrap

dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/bootstrap/DubboBootstrap.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,11 +1033,12 @@ private ServiceInstance createServiceInstance(String serviceName, String host, i
10331033
}
10341034

10351035
public void destroy() {
1036-
// for compatibility purpose
1037-
DubboShutdownHook.destroyAll();
10381036

10391037
if (started.compareAndSet(true, false)
10401038
&& destroyed.compareAndSet(false, true)) {
1039+
// for compatibility purpose
1040+
DubboShutdownHook.destroyAll();
1041+
10411042
unregisterServiceInstance();
10421043
unexportMetadataService();
10431044
unexportServices();

0 commit comments

Comments
 (0)