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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org
For additional commands, e-mail: notifications-h...@dubbo.apache.org

Reply via email to