Sirius-LiXiaoQi commented on issue #16397:
URL: https://github.com/apache/dubbo/issues/16397#issuecomment-5127488897

   Hi~ @zrlw @LI123456mo 
   
   To keep this transparent to the consumer side, would it make sense to 
differentiate the shutdown-time unexport from a regular unexport? The relevant 
code is shown below:
   
   ```
   ### TripleProtocol
   
   //When shutting down
   public void markReadonly() {
           readonly = true;
       }
   
   public void afterUnExport() {
                   if (readonly) {
                       // Requests accepted before this point may not have 
resolved their invoker yet, and the
                       // provider side invoker stays usable after unexport, so 
keep the mappings until destroy()
                       logger.info("Graceful shutdown in progress, keeping 
request mappings of [{}] until destroy", key);
                   } else {
                       // unregister grpc request mapping
                       pathResolver.unregister(invoker);
   
                       // unregister rest request mapping
                       mappingRegistry.unregister(invoker);
   
                       // set service status to NOT_SERVING
                      setServiceStatus(url, false);
   
                      exporterMap.remove(key);
                   }
       }
   
   ```


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