AlexStocks commented on code in PR #3099:
URL: https://github.com/apache/dubbo-go/pull/3099#discussion_r2899086133


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

Review Comment:
   `InternalSignal` 默认值是 `true`(`global/shutdown_config.go` 中 
`default:"true"`),`defaultServerOptions()` 通过 `DefaultShutdownConfig()` 
初始化,所以默认路径直接走 `select{}`,和原来没区别。
   
   真正有变化的路径(`InternalSignal=false`)才走到下面的信号注册逻辑,但这不是默认场景,并没有解决 issue #3042 
的挂死问题。



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