AlexStocks commented on code in PR #1133:
URL: https://github.com/apache/dubbo-go-samples/pull/1133#discussion_r3793191497


##########
graceful_shutdown/go-server/cmd/main.go:
##########
@@ -38,22 +41,36 @@ import (
 )
 
 type GreetProvider struct {
-       fixedDelay time.Duration
+       fixedDelay           time.Duration
+       ignoreContextCancel  bool
+       shutdownOnFirstGreet bool
+       shutdownOnce         sync.Once
+       shuttingDown         atomic.Bool
 }
 
 func (p *GreetProvider) Greet(ctx context.Context, req *greet.GreetRequest) 
(*greet.GreetResponse, error) {
+       if p.shuttingDown.Load() {

Review Comment:
   [P1] 当前 Head `ed5613e` 仍可复现这个根因。我在 WSL / Go 1.25.1 的隔离副本中删除了 Dubbo-Go 
`387ea9a` 的 `waitForSendingAndReceivingRequests` 内唯一一处 
`shutdown.RejectRequest.Store(true)`,再运行 `bash ./integrate_test.sh 
graceful_shutdown`,脚本仍以 0 退出,并完整打印 `Triggering graceful_shutdown`、`reject-stage 
probe` 和 `integration completed`。原因是第二阶段通过 `-reject-request=true` 
在新进程启动时预置拒绝状态,而第一阶段收到 SIGINT 后没有发起新请求,所以测试无法检出真实停机状态切换缺失。请在同一服务进程收到 SIGINT 
后发起独立新请求,断言它未进入 `Greet` handler,并移除用 `WithRejectRequest` 预置结果的第二阶段。



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