AlexStocks commented on a change in pull request #1045:
URL: https://github.com/apache/dubbo-go/pull/1045#discussion_r573621048



##########
File path: protocol/dubbo/dubbo_invoker.go
##########
@@ -87,15 +93,28 @@ func (di *DubboInvoker) Invoke(ctx context.Context, 
invocation protocol.Invocati
                err    error
                result protocol.RPCResult
        )
-       if atomic.LoadInt64(&di.reqNum) < 0 {
+       if !di.BaseInvoker.IsAvailable() {
                // Generally, the case will not happen, because the invoker has 
been removed
                // from the invoker list before destroy,so no new request will 
enter the destroyed invoker
                logger.Warnf("this dubboInvoker is destroyed")
-               result.Err = ErrDestroyedInvoker
+               result.Err = protocol.ErrDestroyedInvoker
+               return &result
+       }
+
+       client := di.getClient()

Review comment:
       关键是,这样锁粒度太大了。可能还是原来的方案好点,顶多在 destroy 里面阻塞下。你再想想




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

Reply via email to