-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
client: call .Endpoints() in dial() in client/v3/client.go instead of accessing cfg.Endpoints directly #13203
Conversation
I agree that this variable needs a lock to prevent data race with Instead of of just adding lock, maybe we should consider adding dedicated endpoint field to |
yeah, I agree. I only fixed what our race detector complained but didn't read the code in detail. There is one thing that if |
nvm, we don't do deep copy in SetEndpoints |
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.
LG
any updates, or should I do something? |
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.
lgtm. Can you please squash commits into one? Thanks @yishuT
… accessing cfg.Endpoints directly https://github.com/etcd-io/etcd/blob/0cdd558361c6bdbbd9e4023558e2f6ece71c18ad/client/v3/client.go#L299 accesses endpoints without acquiring lock. Fix it to call Endpoints() Fix etcd-io#13201
squash commits |
Thanks! |
…lient/v3/client.go instead of accessing cfg.Endpoints directly Signed-off-by: Chao Chen <chaochn@amazon.com>
…lient/v3/client.go instead of accessing cfg.Endpoints directly Signed-off-by: Chao Chen <chaochn@amazon.com>
etcd/client/v3/client.go
Line 299 in 0cdd558
endpoints without acquiring lock. Fix it to call Endpoints()
Fix #13201