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
Pick方法锁调整建议 #1077
Labels
bug
Something isn't working
Comments
感谢建议,请问目前的问题是什么 |
目前没有遇到问题,只是看到这段代码觉得并发情况下这样锁不安全,可能会遇到除0:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/core/loadbalancer/randam.go下的Pick方法锁如下调整是不是更好:
func (r *RandomStrategy) Pick() (*registry.MicroServiceInstance, error) {
r.mtx.Lock()
defer r.mtx.Unlock()
}
The text was updated successfully, but these errors were encountered: