bits-and-blooms / bloom

Go package implementing Bloom filters, used by Milvus and Beego.
BSD 2-Clause "Simplified" License
2.44k stars 232 forks source link

Appears to be data races in Concurrent methods #31

Closed willf closed 7 years ago

willf commented 7 years ago
WARNING: DATA RACE
Read at 0x0000002f40e8 by goroutine 8:
  github.com/willf/bloom.fnv64Hash()
      github.com/willf/bloom/_test/_obj_test/bloom.go:86 +0x134
  github.com/willf/bloom.baseHashes()
      github.com/willf/bloom/_test/_obj_test/bloom.go:95 +0x92
  github.com/willf/bloom.(*BloomFilter).Test()
      github.com/willf/bloom/_test/_obj_test/bloom.go:192 +0x92
  github.com/willf/bloom.TestConcurrent.func2()
      /Users/will/code/go/src/github.com/willf/bloom/bloom_test.go:43 +0x83
willf commented 7 years ago

Oh, this was never designed not to have races :) WONTFIX.

AusIV commented 2 years ago

Could this be called out in the documentation? It's taken a fair bit of digging to determine whether or not I need to throw locks in front of these accesses.