cjphaha commented on a change in pull request #1368:
URL: https://github.com/apache/dubbo-go/pull/1368#discussion_r695119076



##########
File path: registry/zookeeper/service_discovery.go
##########
@@ -306,7 +310,15 @@ func (zksd *zookeeperServiceDiscovery) 
DataChange(eventType remoting.Event) bool
        path = strings.TrimPrefix(path, constant.PATH_SEPARATOR)
        // get service name in zk path
        serviceName := strings.Split(path, constant.PATH_SEPARATOR)[0]
-       err := zksd.DispatchEventByServiceName(serviceName)
+
+       var err error
+       instances := zksd.GetInstances(serviceName)
+       for _, lis := range zksd.instanceListenerMap[serviceName].Values() {
+               var instanceListener registry.ServiceInstancesChangedListener
+               instanceListener = 
lis.(registry.ServiceInstancesChangedListener)

Review comment:
       这里不对断言结果检查的话应该会导致 panic




-- 
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.

To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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

Reply via email to