-
Notifications
You must be signed in to change notification settings - Fork 8k
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
ZookeeperDataSource might not be initialized well unless the ZooKeeper server is active(#588) #597
Conversation
…r server is active(alibaba#588)
Codecov Report
@@ Coverage Diff @@
## master #597 +/- ##
============================================
+ Coverage 39.28% 39.87% +0.58%
- Complexity 1229 1246 +17
============================================
Files 275 275
Lines 8702 8699 -3
Branches 1163 1161 -2
============================================
+ Hits 3419 3469 +50
+ Misses 4846 4784 -62
- Partials 437 446 +9
Continue to review full report at Codecov.
|
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.
Could you please explain your changes?
把上面的代码删除有两个原因: 把代码:
修改为:
当ZookeeperDataSource初始化时,如果zk 服务器异常或者网络问题this.zkClient.getData().forPath(this.path)会执行得特别慢,最终会报错。 |
最终实现初始化时对zk数据源的监听与zk服务器、网络等是否正常无关 |
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.
LGTM
Thanks for contributing! |
[ISSUE alibaba#525] Support the message track. Merge to branch msg_track
Describe what this PR does / why we need it
When the ZookeeperDataSource data source is initialized, if the zk server cannot be used or the connection between the client and the zk server is timed out due to network reasons, the monitoring of the data of the znode node may fail
Does this pull request fix one issue?
Fixes #588
Describe how you did it
NodeCache类本身已经实现了对zk的连接和重连事件进行监听,源码如下:
reset()方法会设置nodeCache的data属性,所以用户可以通过nodeCache.getCurrentData()方法获取。
Describe how to verify it
Special notes for reviews