From 977fffa8500d65720ab23e85a4e263c78b9a02e1 Mon Sep 17 00:00:00 2001
From: Joe Zou <yixian.zou@gmail.com>
Date: Mon, 1 Jun 2020 15:24:01 +0800
Subject: [PATCH] lock optimize

---
 registry/zookeeper/registry.go | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/registry/zookeeper/registry.go b/registry/zookeeper/registry.go
index 32f9fe7a2..912f8c266 100644
--- a/registry/zookeeper/registry.go
+++ b/registry/zookeeper/registry.go
@@ -204,9 +204,7 @@ func (r *zkRegistry) registerTempZookeeperNode(root string, node string) error {
 		zkPath string
 	)
 
-	r.cltLock.Lock()
 	client := r.client
-	r.cltLock.Unlock()
 	if client == nil {
 		return perrors.New("zk Client is null, can not process registerTempZookeeperNode ")
 	}
@@ -260,9 +258,7 @@ func (r *zkRegistry) getListener(conf *common.URL) (*RegistryConfigurationListen
 
 	zkListener = NewRegistryConfigurationListener(r.client, r, conf)
 	if r.listener == nil {
-		r.cltLock.Lock()
 		client := r.client
-		r.cltLock.Unlock()
 		if client == nil {
 			return nil, perrors.New("zk connection broken")
 		}
-- 
GitLab