Oxidaner commented on code in PR #3293:
URL: https://github.com/apache/dubbo-go/pull/3293#discussion_r3090638619
##########
server/server.go:
##########
@@ -323,9 +328,29 @@ func (s *Server) Serve() error {
}
// prevent multiple calls to Serve
s.serve = true
+ s.stopCh = make(chan struct{})
+ s.serveDone = make(chan struct{})
+ s.stopOnce = sync.Once{}
+ s.stopperID = 0
+ stopCh := s.stopCh
+ serveDone := s.serveDone
// release lock in case causing deadlock
s.mu.Unlock()
+ defer func() {
+ s.mu.Lock()
+ stopperID := s.stopperID
+ if s.serveDone == serveDone {
+ s.serve = false
+ s.stopCh = nil
+ s.serveDone = nil
+ s.stopperID = 0
+ }
+ s.mu.Unlock()
+
+ graceful_shutdown.UnregisterServerStopper(stopperID)
+ close(serveDone)
+ }()
Review Comment:
目前不会 我已修改
--
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]