Skip to content
Snippets Groups Projects
Commit 4ec5a7c0 authored by wangwx's avatar wangwx
Browse files

fix coredump

parent e5266a57
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ var (
type ZookeeperClient struct {
name string
ZkAddrs []string
sync.Mutex // for conn
sync.RWMutex // for conn
Conn *zk.Conn
Timeout time.Duration
exit chan struct{}
......
......@@ -239,8 +239,13 @@ func (l *ZkEventListener) listenDirEvent(zkPath string, listener remoting.DataLi
l.pathMapLock.Lock()
l.pathMap[dubboPath] = struct{}{}
l.pathMapLock.Unlock()
//When Zk disconnected, the Conn will be set to nil, so here need check the value of Conn
l.client.RLock()
if l.client.Conn == nil{
break
}
content, _, err := l.client.Conn.Get(dubboPath)
l.client.RUnlock()
if err != nil {
logger.Errorf("Get new node path {%v} 's content error,message is {%v}", dubboPath, perrors.WithStack(err))
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment