diff --git a/remoting/zookeeper/listener.go b/remoting/zookeeper/listener.go index b6c6d78106a5a97ec94e621d2e664185a8216656..e5ddcadeaca9c3ce972cbe781413ebec7393afce 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() + defer l.pathMapLock.Unlock() + delete(l.pathMap, zkPath) } logger.Warnf("listenSelf(zk path{%s}) goroutine exit now", zkPath) }(dubboPath, listener)