We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I think that calling updater.Reset at https://github.com/matryer/goblueprints/blob/master/chapter5/counter/main.go#L98 causes a race condition
updater.Reset
(the other access is at https://github.com/matryer/goblueprints/blob/master/chapter5/counter/main.go#L76)
The text was updated successfully, but these errors were encountered:
That's an interesting one. Are you sure it causes a race condition?
Sorry, something went wrong.
I think so ...
With build -race, this stack is displayed when counter is executed
build -race
counter
2015/04/20 11:26:03 Finished updating database... ================== WARNING: DATA RACE Read by goroutine 23: main.func·004() /Users/brox/GoPath/src/github.com/matryer/goblueprints/chapter5/counter/main.go:98 +0x1f4 Previous write by main goroutine: main.main() /Users/brox/GoPath/src/github.com/matryer/goblueprints/chapter5/counter/main.go:99 +0xb3e Goroutine 23 (running) created at: time.goFunc() /usr/local/go/src/time/sleep.go:129 +0x59 ================== 2015/04/20 11:26:04 Updating database...
[...]
2015/04/20 11:29:19 INF 1 [votes/counter] stopping handlers 2015/04/20 11:29:19 INF 1 [votes/counter] exiting lookupdLoop 2015/04/20 11:29:19 INF 1 [votes/counter] rdyLoop exiting 2015/04/20 11:29:19 Closing database connection... Found 1 data race(s)
That's very interesting - thanks.
Successfully merging a pull request may close this issue.
I think that calling
updater.Reset
at https://github.com/matryer/goblueprints/blob/master/chapter5/counter/main.go#L98causes a race condition
(the other access is at https://github.com/matryer/goblueprints/blob/master/chapter5/counter/main.go#L76)
The text was updated successfully, but these errors were encountered: