-
Notifications
You must be signed in to change notification settings - Fork 1.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
Zookeeper graceful shutdown #17
Conversation
20053e2
to
fa1b81c
Compare
fix: 移除无用consul开关
fa1b81c
to
e11b312
Compare
for (URL u : getRegisteredServiceUrls()) { | ||
String info = u.toFullStr(); | ||
|
||
String unavaliabeServerNodePath = toUnavaliableServerNodePath(u); |
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.
available拼错了
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.
available和unavailable做的内容是类似的,是否用参数区分,避免代码重复?
需要补充单元测试,并且评估一下服务上下线对zk集群性能的影响 |
return nodeChildsToUrls(parentPath, currentChilds); | ||
} catch (Throwable e) { | ||
throw new MotanFrameworkException(String.format("Failed to discover %s from zookeeper(%s), cause: %s", url, getUrl(), e.getMessage())); | ||
} | ||
} | ||
|
||
@Override | ||
protected void doAvailable(URL url) { | ||
if (url == null) { |
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.
registeredServiceUrls有一个bug:
假如当前有3个unavailable url
当先调用available(url1)时,url1正常工作
再调用available(null)时,会再次重置url1
reference to #5 |
9687017
to
9f1d1e4
Compare
ZooKeeper支持通过心跳开关来改变服务工作状态
修改相关文档