coreos/etcd — pull request #630 by benbjohnson (2014-03-16 23:21:36+00:00)
Title: fix: race detector failures

This pull request fixes all race conditions reported by the Go race detector as reported by @titanous in #600:

* `server/v2/tests`
* `mod/lock/v2/tests`
* `tests/functional`
* `tests/functional` with `-race` enabled in `./build`

I tried to use `sync/atomic` on the leader value in go-raft for a while but could not get it to work. It doesn't seem like string values will work with that package -- even with `StorePointer` and `LoadPointer`.

I'll add a separate pull request for go-raft after this is reviewed.

*Note*: This commit still experiences the same issue as [Drone build 91](https://drone.io/github.com/coreos/etcd/91) so the build still hangs towards the end.

/cc @xiangli-cmu @philips