AlexStocks commented on code in PR #3612:
URL: https://github.com/apache/dubbo-go/pull/3612#discussion_r3788484596


##########
config_center/zookeeper/listener.go:
##########
@@ -58,31 +88,157 @@ func (l *CacheListener) AddListener(key string, listener 
config_center.Configura
                
listeners.(map[config_center.ConfigurationListener]struct{})[listener] = 
struct{}{}
                l.keyListeners.Store(key, listeners)
        }
+       if l.cache != nil {
+               l.cache.promoteWatch(key)
+       }
+}
+
+func (l *CacheListener) restoreBusinessWatches() {
+       if l.cache == nil || !l.cache.enabled() || l.zkEventListener == nil ||
+               l.zkEventListener.Client == nil || 
l.zkEventListener.Client.Conn == nil {
+               return
+       }

Review Comment:
   [P1] cache-ttl=0 的重连路径仍会永久丢失业务 watch
   
   当前 AddListener 在缓存关闭时仍会为业务 listener 建立 ZooKeeper watch;重连后 RestartCallBack() 
会先 reset 旧 watch,再调用这里恢复。但这里在 !l.cache.enabled() 
时直接返回,因此缓存关闭这一受支持配置下没有任何重新注册路径,后续节点更新不会再通知 listener。请把业务 watch 的恢复与 
read-through cache 是否启用解耦,并补充 cache-ttl=0 -> AddListener -> reconnect -> 
更新节点仍收到事件 的回归测试。



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to