etcd component init IsHealth check Get operation context set timeout #86
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link to an issue
related issue #82
What
etcd config 添加了 timeout 配置, IsHealth 方法在 Get health key 的 context 添加对应的超时设置
How
etcd config 添加属性以及方法,如果配置无效,则方法会返回默认值 3s,在IsHealth客户端调用前获取config,并调用其方法获取 timeout 配置,并最后根据 timeout 创建 context,传入 Get
Screenshots
How to test
config.yaml 添加对应的 timeout 配置,并停止 etcd 服务,程序将出现超时
Checklist
rebaseto confirm that current branch doesn't conflict with main branch.guidelines.mdwhich used to describe how to build, deploy and use DouTok.