minio / dsync

A distributed sync package.
Apache License 2.0
400 stars 41 forks source link

tests: go test -race reports races. #13

Closed harshavardhana closed 8 years ago

harshavardhana commented 8 years ago
WARNING: DATA RACE
Write by goroutine 102:
  runtime.slicecopy()
      /home/harsha/.gimme/versions/go1.6.2.linux.amd64/src/runtime/slice.go:113 +0x0
  github.com/minio/dsync.(*DRWMutex).Lock()
      /home/harsha/mygo/src/github.com/minio/dsync/drwmutex.go:132 +0x37e
  github.com/minio/dsync.TestThreeSimultaneousLocksForSameResource.func2()
      /home/harsha/mygo/src/github.com/minio/dsync/dmutex_test.go:253 +0x8d

Previous write by goroutine 188:
  github.com/minio/dsync.(*DRWMutex).Unlock()
      /home/harsha/mygo/src/github.com/minio/dsync/drwmutex.go:315 +0x2d5
  github.com/minio/dsync.TestThreeSimultaneousLocksForSameResource.func3.1()
      /home/harsha/mygo/src/github.com/minio/dsync/dmutex_test.go:271 +0x110

Goroutine 102 (running) created at:
  github.com/minio/dsync.TestThreeSimultaneousLocksForSameResource()
      /home/harsha/mygo/src/github.com/minio/dsync/dmutex_test.go:259 +0x6ed
  testing.tRunner()
      /home/harsha/.gimme/versions/go1.6.2.linux.amd64/src/testing/testing.go:473 +0xdc

Goroutine 188 (finished) created at:
  github.com/minio/dsync.TestThreeSimultaneousLocksForSameResource.func3()
      /home/harsha/mygo/src/github.com/minio/dsync/dmutex_test.go:272 +0x7f
fwessels commented 8 years ago

Fixed by PR #24