-
Notifications
You must be signed in to change notification settings - Fork 26.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix the bug can't subscribe the interface #5085 #5086
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5086 +/- ##
============================================
+ Coverage 64% 64.02% +0.02%
- Complexity 451 452 +1
============================================
Files 769 769
Lines 33251 33293 +42
Branches 5247 5251 +4
============================================
+ Hits 21282 21316 +34
- Misses 9541 9543 +2
- Partials 2428 2434 +6
Continue to review full report at Codecov.
|
这么做的话,zookeeper上短时间内删除和增加相同的节点会导致所有机器重新subcribe这些节点,会不会网络波动有点大? |
谢谢反馈,但是没明白你的意思,这个改动只是新增了在节点被删除后对内部已订阅节点的缓存的清理,我觉得这是符合逻辑的,至于你说的上下线导致的网络流量过大这个问题,是zookeeper作为注册中心一直有的问题,和pr应该没啥直接联系。 |
@@ -138,14 +139,18 @@ public void doSubscribe(final URL url, final NotifyListener listener) { | |||
ChildListener zkListener = listeners.get(listener); | |||
if (zkListener == null) { | |||
listeners.putIfAbsent(listener, (parentPath, currentChilds) -> { | |||
List<String> copy = new LinkedList<>(anyServices); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor: using iterators to remove child is better ?
@CodingSinger Hi, thanks for your contributions. Please merge the latest master branch to resolve confilcting files. |
Close for long time no response. Please feel free to reopen if you have any question. If you think these changes still useful in the latest master branch, please submit a new pull request. |
fix the bug #5085