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



##########
File path: 
dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java
##########
@@ -906,19 +907,6 @@ private void destroyProtocols() {
         }
     }
 
-    private void destroyServiceDiscoveries() {
-        
RegistryManager.getInstance(applicationModel).getServiceDiscoveries().forEach(serviceDiscovery
 -> {
-            try {
-                serviceDiscovery.destroy();
-            } catch (Throwable ignored) {
-                logger.warn(ignored.getMessage(), ignored);
-            }
-        });
-        if (logger.isDebugEnabled()) {
-            logger.debug(getIdentifier() + "'s all ServiceDiscoveries have 
been destroyed.");
-        }
-    }
-

Review comment:
       destroyRegistries() destroy all registries including service discoveries:
   ```
       private void destroyRegistries() {
           RegistryManager.getInstance(applicationModel).destroyAll(); 
       }
   ```
   RegistryManager#destroyAll()
   ```
       public void destroyAll() {
          ...
           try {
               for (Registry registry : getRegistries()) {
                   try {
                       registry.destroy(); <== destroy registry including 
service discovery.
                   } catch (Throwable e) {
                       LOGGER.warn(e.getMessage(), e);
                   }
               }
               registries.clear(); <== clear registries map whch includes 
service discoveries.
          ...
       }
   ```




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