hashicorp / memberlist

Golang package for gossip based membership and failure detection
Mozilla Public License 2.0
3.66k stars 443 forks source link

Fix data races #232

Closed dnephin closed 3 years ago

dnephin commented 3 years ago

Fixes #134 Fixes #113 Closes #179

This PR fixes a number of data races and runs tests in CI using go test -race to catch any regressions. Also updates the version of Go used in CI to 1.15. I tried upgrading to 1.16 but there are a number of problems (for some reason the $PATH in that 1.16 image is wrong, and go vet reports more problems https://golang.org/doc/go1.16#vet, so I'll defer that upgrade to another PR).

Lots of detail in the commit messages, best viewed by individual commit.

The EventDelegate is really only a partial fix for these tests. The data race is still there, and unfortunately it seems like the interface is a problem.