From ed402110ff98a26c8c7e5c594c63ce70df31ffb9 Mon Sep 17 00:00:00 2001 From: pantianying <601666418@qq.com> Date: Sat, 15 Feb 2020 15:16:44 +0800 Subject: [PATCH] fix bug --- protocol/dubbo/dubbo_invoker.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol/dubbo/dubbo_invoker.go b/protocol/dubbo/dubbo_invoker.go index a7ae57780..ef5016e22 100644 --- a/protocol/dubbo/dubbo_invoker.go +++ b/protocol/dubbo/dubbo_invoker.go @@ -72,7 +72,7 @@ func (di *DubboInvoker) Invoke(ctx context.Context, invocation protocol.Invocati err error result protocol.RPCResult ) - if di.reqNum == -1 { + if di.reqNum < 0 { // 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") @@ -127,13 +127,13 @@ func (di *DubboInvoker) Destroy() { di.quitOnce.Do(func() { for { if di.reqNum == 0 { + di.reqNum = -1 logger.Info("dubboInvoker is destroyed,url:{%s}", di.GetUrl().Key()) di.BaseInvoker.Destroy() if di.client != nil { di.client.Close() di.client = nil } - di.reqNum = -1 break } logger.Warnf("DubboInvoker is to be destroyed, wait {%v} req end,url:{%s}", di.reqNum, di.GetUrl().Key()) -- GitLab