globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 230 forks source link

Data Race at startup #344

Closed primalmotion closed 4 years ago

primalmotion commented 5 years ago

What version of MongoDB are you using (mongod --version)?

4..0

What version of Go are you using (go version)?

1.12.2

What operating system and processor architecture are you using (go env)?

macOS

What did you do?

Just starting my backend:

==================
WARNING: DATA RACE
Read at 0x0000016b3678 by goroutine 7:
  time.Now()
      /usr/local/go/src/time/time.go:1060 +0xcf
  time.sendTime()
      /usr/local/go/src/time/sleep.go:141 +0x44

Previous write at 0x0000016b3678 by main goroutine:
  [failed to restore the stack]

Goroutine 7 (running) created at:
  runtime.(*timersBucket).addtimerLocked()
      /usr/local/go/src/runtime/time.go:170 +0x113
  go.aporeto.io/backend/vendor/github.com/globalsign/mgo.newcoarseTimeProvider.func1()
      /tmp/build/6cad771a/go/src/go.aporeto.io/backend/vendor/github.com/globalsign/mgo/coarse_time.go:49 +0x50
==================

This only happens once it starts, but almost everytime