From c8ed2800497d0154411c6ad381edfe72ad58b79c Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Fri, 22 Jul 2022 13:47:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Drpc=20=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E7=AB=AF=E9=94=81=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lego/sys/rpcx/service.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lego/sys/rpcx/service.go b/lego/sys/rpcx/service.go index 598f3bf23..408e958e5 100644 --- a/lego/sys/rpcx/service.go +++ b/lego/sys/rpcx/service.go @@ -352,18 +352,18 @@ func (this *Service) call(ctx context.Context, clusterTag string, servicePath st err = fmt.Errorf("on found serviceTag:%s", clusterTag) return } - this.clientmutex.RLock() + if clientaddr = selector.Select(ctx, spath[0], serviceMethod, args); clientaddr == "" { err = fmt.Errorf("on found servicePath:%s", servicePath) + return + } + this.clientmutex.RLock() + if conn, ok = this.clients[clientaddr]; !ok { + err = fmt.Errorf("on found clientaddr:%s", clientaddr) this.clientmutex.RUnlock() return } this.clientmutex.RUnlock() - if conn, ok = this.clients[clientaddr]; !ok { - err = fmt.Errorf("on found clientaddr:%s", clientaddr) - return - } - _call = new(client.Call) _call.ServicePath = servicePath _call.ServiceMethod = serviceMethod