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

Data Race in DialWithInfo #186

Closed
ericmillin opened this issue Jun 8, 2018 · 3 comments
Closed

Data Race in DialWithInfo #186

ericmillin opened this issue Jun 8, 2018 · 3 comments
Assignees

Comments

@ericmillin
Copy link

ericmillin commented Jun 8, 2018

We have an overburdened CI server that is exposing during testing the following race:

==================
WARNING: DATA RACE
Write at 0x00c420571f68 by goroutine 15:
  vendor/github.com/globalsign/mgo.DialWithInfo()
      vendor/github.com/globalsign/mgo/session.go:602 +0x55e
 

Previous read at 0x00c420571f68 by goroutine 158:
  vendor/github.com/globalsign/mgo.(*mongoCluster).server()
      vendor/github.com/globalsign/mgo/cluster.go:442 +0x83
  vendor/github.com/globalsign/mgo.(*mongoCluster).syncServersIteration.func1.1()
      vendor/github.com/globalsign/mgo/cluster.go:556 +0x1da

Goroutine 15 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:824 +0x564
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:1063 +0xa4
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:777 +0x16d
  testing.runTests()
      /usr/local/go/src/testing/testing.go:1061 +0x4e1
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:978 +0x2cd
  main.main()
      _testmain.go:44 +0x22a

Goroutine 158 (running) created at:
  vendor/github.com/globalsign/mgo.(*mongoCluster).syncServersIteration.func1()
      vendor/github.com/globalsign/mgo/cluster.go:529 +0x174
  vendor/github.com/globalsign/mgo.(*mongoCluster).syncServersIteration()
      vendor/github.com/globalsign/mgo/cluster.go:584 +0x490
  vendor/github.com/globalsign/mgo.(*mongoCluster).syncServersLoop()
      vendor/github.com/globalsign/mgo/cluster.go:392 +0x17b

Should be pretty self-explanatory, but let me know if you have any questions.

@domodwyer
Copy link

Hi @ericmillin

What commit are you running? Have you seen #178 ? Maybe try development - it might already be resolved.

Dom

@jerome-laforge
Copy link

jerome-laforge commented Jun 14, 2018

Hello @domodwyer ,
I was not able to reproduce this issue onto development branch with my tests.
On the other hand, I was able to reproduce this race onto master branch with my tests.

Jérôme

@domodwyer
Copy link

Awesome, thanks for checking @jerome-laforge!

There's a release PR out so this should be in master soon :)

Dom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants