fix potential mutext conflict between doCrossDCRegister and doRegister#297
Open
fix potential mutext conflict between doCrossDCRegister and doRegister#297
doCrossDCRegister and doRegister#297Conversation
…ster` 这两个函数,都是在持有锁的时候进行 IO 操作(访问 etcd)。 当因为网络或其他原因,访问 etcd 很慢时,二者会相互影响,最终导致注册信息失效。 比如,当 `doCrossDCRegister` 很慢时,耗时 N 分钟,此时锁被 `doCrossDCRegister` 持有, `doRegister` 迟迟无法获得锁,最终对应 etcd 上的注册信息失效,调用方报错,无可用实例。 实际上,此两函数执行的动作,完全不必加锁。
Contributor
|
LGTM |
2 similar comments
Collaborator
|
LGTM |
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
这两个函数,都是在持有锁的时候进行 IO 操作(访问 etcd)。
当因为网络或其他原因,访问 etcd 很慢时,二者会相互影响,最终导致注册信息失效。
比如,当
doCrossDCRegister很慢时,耗时 N 分钟,此时锁被doCrossDCRegister持有,doRegister迟迟无法获得锁,最终对应 etcd 上的注册信息失效,调用方报错,无可用实例。实际上,此两函数执行的动作,完全不必加锁。