win5do commented on a change in pull request #1254:
URL: https://github.com/apache/dubbo-go/pull/1254#discussion_r650462930
##########
File path: config/graceful_shutdown.go
##########
@@ -163,6 +163,7 @@ func waitForReceivingRequests() {
// ignore this step
return
}
+ providerConfig.ShutdownConfig.RejectRequest = true
Review comment:
graceful shutdown 时拒绝新请求不合适,会导致请求失败。
参考 grpc,先是关闭 listener,拒绝新连接,而不是请求。
##########
File path: filter/filter_impl/graceful_shutdown_filter.go
##########
@@ -60,6 +60,9 @@ func (gf *gracefulShutdownFilter) Invoke(ctx context.Context,
invoker protocol.I
return
gf.getRejectHandler().RejectedExecution(invoker.GetURL(), invocation)
}
atomic.AddInt32(&gf.activeCount, 1)
+ if gf.shutdownConfig != nil && gf.activeCount > 0 {
+ gf.shutdownConfig.RequestsFinished = false
Review comment:
没有锁,会导致 data race。
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]