Nacos service watcher 是否有潜在的服务泄漏? #769
Answered
by
johnlanni
spacewander
asked this question in
Q&A
-
higress/registry/nacos/v2/watcher.go Line 386 in c9c7df7 unsubscribe 的时候,看上去 Cache 里面对应 service 生成的 ServiceEntry 并没有被删除,这样就只能等待整个 watcher 更新时才会被删掉? 另外, higress/registry/nacos/v2/watcher.go Line 415 in c9c7df7 当 updateCacheWhenEmpty 为真时,实际上 ServiceEntry 并不会被删除,需要等待整个 watcher 更新时才会被真正删掉。 |
Beta Was this translation helpful? Give feedback.
Answered by
johnlanni
Jan 30, 2024
Replies: 1 comment 2 replies
-
@spacewander 感谢关注,discussion没及时看不好意思,后面可以直接ping我。 这里是因为nacos在启动阶段时,higress去fetchAllServices可能会只拿到部分服务,所以不能直接在unsubscribe的时候就删除对应的ServiceEntry,因为实际上服务实例可能还在。 一般场景下服务数会趋向一个常量,这里的影响还好。 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
是的