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 race #265

Merged
merged 2 commits into from
Aug 25, 2019
Merged

fix race #265

merged 2 commits into from
Aug 25, 2019

Conversation

zhanyr
Copy link

@zhanyr zhanyr commented Aug 23, 2019

we got a race like this :

WARNING: DATA RACE
Read at 0x00c000249260 by goroutine 16:
gmessage-server/vendor/github.com/rcrowley/go-metrics.(*StandardRegistry).registered()
/home/work/buildspace/2d9632c8a4/.gopath/src/gmessage-server/vendor/github.com/rcrowley/go-metrics/registry.go:222 +0x91
gmessage-server/vendor/github.com/rcrowley/go-metrics.(*StandardRegistry).Each()
/home/work/buildspace/2d9632c8a4/.gopath/src/gmessage-server/vendor/github.com/rcrowley/go-metrics/registry.go:67 +0x3c
...

Previous write at 0x00c000249260 by goroutine 131:
runtime.mapassign_faststr()
/usr/local/go/src/runtime/map_faststr.go:190 +0x0
gmessage-server/vendor/github.com/rcrowley/go-metrics.(*StandardRegistry).register()
/home/work/buildspace/2d9632c8a4/.gopath/src/gmessage-server/vendor/github.com/rcrowley/go-metrics/registry.go:211 +0x113
gmessage-server/vendor/github.com/rcrowley/go-metrics.(*StandardRegistry).GetOrRegister()
/home/work/buildspace/2d9632c8a4/.gopath/src/gmessage-server/vendor/github.com/rcrowley/go-metrics/registry.go:103 +0x255
gmessage-server/vendor/github.com/rcrowley/go-metrics.GetOrRegisterTimer()
/home/work/buildspace/2d9632c8a4/.gopath/src/gmessage-server/vendor/github.com/rcrowley/go-metrics/timer.go:38 +0x77
...

@mihasya
Copy link
Collaborator

mihasya commented Aug 24, 2019

Thanks for catching this, @zhanyr and @lechnertech.

Would one of you mind adding a test that exercises this condition? We do run tests with -race as part of the build, so we can prevent further regressions easily if a test is added. Thanks!

@zhanyr
Copy link
Author

zhanyr commented Aug 25, 2019

done.

@mihasya
Copy link
Collaborator

mihasya commented Aug 25, 2019

Thanks!

@mihasya mihasya merged commit 3c7535c into rcrowley:master Aug 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants