ywxzm03 commented on PR #3612:
URL: https://github.com/apache/dubbo-go/pull/3612#issuecomment-5392019726

   
由于ZK依赖从`github.com/dubbogo/go-zookeeper`迁移至`github.com/go-zookeeper/zk`,这边也做了一些兼容性处理,主要是重新设计了watch生命周期:
   
   - 适配 upstream `go-zookeeper` API,将 `*zk.Watcher` 改为事件通道,并移除对 `RemoveWatcher` 
的依赖;所以watch的删除行为需要改为事件消费清除watch:当 auto watch 已达到上限且最后一个业务 listener 被删除时,将该 
watch 标记为 `retired`;后续残留事件到达时不再重新注册 watch,而是使用普通 `Exists/Get` 更新缓存
   - 完善 auto watch 与 business watch 的 ownership、`pending`、`retired` 
状态及容量限制;容量达到上限时,普通缓存路径降级为 TTL
   - 增加 session ID 和 generation 校验,避免重连或并发过程中旧 watch、旧读取结果覆盖当前缓存状态
   - 同步 `AddListener`、`RemoveListener`、watch 重试和 `DataChange`,避免重复注册、无效重试及 
listener 删除竞态
   - 重构事件处理,区分 `Accepted`、`Reload` 和 `Discarded` 三种 watch 注册结果
   - 增加缓存边界、并发注册、重连恢复、旧结果隔离、事件处理及关闭退出相关测试


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