kylixs commented on a change in pull request #9033:
URL: https://github.com/apache/dubbo/pull/9033#discussion_r728613024



##########
File path: dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ScopeModel.java
##########
@@ -69,7 +69,6 @@
 
     private Map<String, Object> attributes;
     private AtomicBoolean destroyed = new AtomicBoolean(false);
-    private volatile boolean stopping;
 

Review comment:
       Let's take a look at the new processing of application destroy:
   1. Destroy by application
   ```
   ApplicationModel.destroy() (change destroyed to true) 
   -> ApplicationModel.onDestroy()
   -> ApplicationDeployer.preDestroy()  
      -> set state to stopping 
   -> destroy all modules and remove self from frameworkModel
   -> ApplicationDeployer.postDestroy()  
       -> cancel asyncMetadataFuture and unregisterServiceInstance
       -> ...
       -> set state to stopped
   -> frameworkModel.tryDestroy()
   ```
   ApplicationModel and ApplicationDeployer have a strange relationship, 
ApplicationDeployer is designed to handle Application start/stop. 
ApplicationDeployer is an associated object of ApplicationModel and becomes 
clearer when it is destroyed from ApplicationModel.destroy().
   
   2. Destroy by module
   ```
   ModuleModel.destroy()
   -> ModuleModel.onDestroy()
   -> ModuleDeployer.preDestroy()  
       -> set module state to stopping
   -> remove module from application
   -> ModuleDeployer.postDestroy()
      -> unexport and unrefer services
      -> set module state to stopped
   -> applicationModel.tryDestroy()
   ```
   Destroy pub modules one by one, if only remain internal module, then call  
`ApplicationModel.destroy()`
   




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