AlexStocks commented on code in PR #3293:
URL: https://github.com/apache/dubbo-go/pull/3293#discussion_r3151143439
##########
server/server.go:
##########
@@ -326,6 +341,13 @@ func (s *Server) Serve() error {
// release lock in case causing deadlock
s.mu.Unlock()
+ defer func() {
+ s.mu.Lock()
+ s.serve = false
Review Comment:
[P1] 这里在 ServeContext 返回时总是把 s.serve 重置为 false,但 graceful_shutdown.Done() /
shutdownOnce 是进程级一次性状态。第一次 shutdown 完成后 Done 已关闭,后续再次调用 ServeContext 会通过 serve
检查、重新 export 服务并注册实例,随后立刻命中已关闭的 graceful_shutdown.Done() 返回;由于
Shutdown(context.Background()) 不会再次执行 beforeShutdown,这次新 export/register 的资源不会被
unexport 或 unregister。需要在 shutdown 已完成后拒绝再次 Serve,或在重新启动前重置 graceful shutdown
状态并保证返回路径会清理本次启动的资源,同时补一个 shutdown 后二次 Serve 的回归测试。
--
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]