diff --git a/remoting/zookeeper/listener.go b/remoting/zookeeper/listener.go index b6c6d78106a5a97ec94e621d2e664185a8216656..99167088ae4396adf2c914b06969455b7030be7d 100644 --- a/remoting/zookeeper/listener.go +++ b/remoting/zookeeper/listener.go @@ -301,6 +301,9 @@ func (l *ZkEventListener) listenDirEvent(conf *common.URL, zkPath string, listen go func(zkPath string, listener remoting.DataListener) { if l.listenServiceNodeEvent(zkPath) { listener.DataChange(remoting.Event{Path: zkPath, Action: remoting.EventTypeDel}) + l.pathMapLock.Lock() + delete(l.pathMap, zkPath) + l.pathMapLock.Unlock() } logger.Warnf("listenSelf(zk path{%s}) goroutine exit now", zkPath) }(dubboPath, listener)