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

*: fix various data races detected by race detector #3758

Merged
merged 1 commit into from
Oct 27, 2015

Conversation

xiang90
Copy link
Contributor

@xiang90 xiang90 commented Oct 27, 2015

I run etcd under high load in real env. No race is detected.

The races are detected by enabling race detector for integration test. But all of them happens at VERY low frequent (only happens when there is a cluster configuration change)

p, ok := t.peers[to]
t.mu.RUnlock()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mu is used to protect the remote and peer map, and i see g, ok := t.remotes[to] 10 lines below, so I think it needs this lock too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but when running, this cannot happen because we only AddRemote before sending messages.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can clean this up in the near future. I am trying to clean up the race detected by the race detector in the commit. Or you want me to go over the code?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for this PR.

@yichengq
Copy link
Contributor

lgtm if CI passes.

xiang90 added a commit that referenced this pull request Oct 27, 2015
*: fix various data races detected by race detector
@xiang90 xiang90 merged commit 70f9407 into etcd-io:master Oct 27, 2015
@xiang90 xiang90 deleted the race branch October 27, 2015 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants