Skip to content
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

Closed
zhousiliang163 opened this issue Mar 19, 2019 · 3 comments · Fixed by #597
Labels
area/integrations Issues or PRs related to integrations with open-source components good first issue Good for newcomers kind/enhancement Category issues or prs related to enhancement.

Comments

@zhousiliang163
Copy link
Contributor

Issue Description

Type: bug report or feature request

Describe what happened (or what feature you want)

在初始化ZookeeperDataSource数据源时,如果zk server不能用或者因网络原因导致client与zk server连接超时等,会造成对znode节点数据的监听失败,如下图:
图片
红色标注的地方,可能会执行报错,导致后面的监听器注册失败。

Describe what you expected to happen

是否可以加个连接事件,等连接成功后,再去执行后面的NodeCacheListener注册

How to reproduce it (as minimally and precisely as possible)

Tell us your environment

Anything else we need to know?

@sentinel-bot
Copy link
Collaborator

Hi @zhousiliang163, we detect non-English characters in the issue. This comment is an auto translation from @sentinel-bot to help other users to understand this issue.
We encourage you to describe your issue in English which is more friendly to other users.

Currently only supports the ZookeeperDataSource when the zookeeper server is normal.

Issue Description

Type: bug report or feature request

Describe what happened (or what feature you want)

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, as shown in the following figure:
图片
Where the red is marked, an error may be reported, causing the subsequent listener registration to fail.

Describe what you expected to happen

Whether it is possible to add a connection event, and wait for the connection to succeed, then perform the subsequent NodeCacheListener registration.

How to reproduce it (as minimally and precisely as possible)

Tell us your environment

Anything else we need to know?

@sentinel-bot sentinel-bot changed the title 目前只支持在zookeeper server正常的情况下,才能很好地初始化ZookeeperDataSource Currently only supports the ZookeeperDataSource when the zookeeper server is normal. Mar 19, 2019
@sczyh30 sczyh30 added kind/enhancement Category issues or prs related to enhancement. good first issue Good for newcomers area/integrations Issues or PRs related to integrations with open-source components labels Mar 19, 2019
@sczyh30 sczyh30 changed the title Currently only supports the ZookeeperDataSource when the zookeeper server is normal. ZookeeperDataSource might not be initialized well unless the ZooKeeper server is active Mar 19, 2019
@sczyh30
Copy link
Member

sczyh30 commented Mar 19, 2019

Hi, thanks for your suggestion. It's reasonable to deal with circumstances on connection error. Would you like to contribute a PR to improve this?

@zhousiliang163
Copy link
Contributor Author

zhousiliang163 commented Mar 19, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/integrations Issues or PRs related to integrations with open-source components good first issue Good for newcomers kind/enhancement Category issues or prs related to enhancement.
Projects
None yet
3 participants