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


##########
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] 当前修复仍未覆盖停机阶段的拒绝切换。第二阶段通过 `-reject-request=true` 在 server 启动前直接执行 
`WithRejectRequest()`,随后没有发送 SIGINT;第一阶段又只有一个在途请求,没有停机后的新请求。因此即使删除 Dubbo-Go 
`waitForSendingAndReceivingRequests()` 中真正把 `RejectRequest` 从 false 置为 true 
的逻辑,这个测试仍会通过。请在同一次真实停机中,等待 SIGINT 后框架进入拒绝阶段,再由独立客户端发起新请求并断言未进入 `Greet` 
handler;回归测试必须能检出移除该状态切换的实现。



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