You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/01/21 05:45:09 UTC

[GitHub] [dubbo-go] champly commented on a change in pull request #985: Fix: consumer invoker cache set nil after the ZK connection is lost

champly commented on a change in pull request #985:
URL: https://github.com/apache/dubbo-go/pull/985#discussion_r561616544



##########
File path: remoting/zookeeper/client.go
##########
@@ -259,14 +259,14 @@ func (z *ZookeeperClient) HandleZkEvent(session <-chan zk.Event) {
 			switch (int)(event.State) {
 			case (int)(zk.StateDisconnected):
 				logger.Warnf("zk{addr:%s} state is StateDisconnected, so close the zk client{name:%s}.", z.ZkAddrs, z.name)
-				z.stop()
 				z.Lock()
 				conn := z.Conn
 				z.Conn = nil
 				z.Unlock()
 				if conn != nil {
 					conn.Close()
 				}
+				z.stop()

Review comment:
       应该是stop发出去了,但z.Conn还没清空,重新`ValidateZookeeperClient`里面发现 Conn 不为空,不会重新连接(不会重连失败),然后继续执行stop之后的逻辑就把连接关了




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org