AlexStocks commented on code in PR #3099:
URL: https://github.com/apache/dubbo-go/pull/3099#discussion_r2700757639
##########
server/server.go:
##########
@@ -329,7 +333,31 @@ func (s *Server) Serve() error {
if err := exposed_tmp.RegisterServiceInstance(); err != nil {
return err
}
- select {}
+
+ // Check if graceful_shutdown package is handling signals internally
+ // If InternalSignal is true (default), graceful_shutdown.Init()
already set up signal handling
+ // and will call os.Exit(0) after cleanup, so we just block here.
+ // If InternalSignal is false, we need to handle signals ourselves and
call cleanup.
+ if s.cfg.Shutdown != nil && s.cfg.Shutdown.InternalSignal != nil &&
*s.cfg.Shutdown.InternalSignal {
+ // graceful_shutdown package is handling signals, just block
until shutdown
+ select {}
Review Comment:
其实这是这里面最主要的改动,就是别用 select{} 这种代码,不要保留它
--
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]