wenxuwan commented on a change in pull request #1045:
URL: https://github.com/apache/dubbo-go/pull/1045#discussion_r573643072
##########
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本身就只会调用一次,invoke的时候拿的是读锁,destroy的时候才会发生互斥。所以你拿出来不拿出来都是在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]