This repository has been archived by the owner on Jun 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
TestHasIsBloomCached failures #6
Comments
I believe I found the root cause for this test failure. It appears to be a race condition/ timing issue that sometimes causes ' I was able to consistently reproduce this test failure after adding a 300 Microsecond sleep in Rebuild. @Stebalien @Kubuxu @lgierth, @whyrusleeping Thoughts? Rebuild's() Goroutine: close(b.rebuildChan)
time.Sleep(300 * time.Microsecond) //<-- Temp Code that reproduces the test failure
atomic.StoreInt32(&b.active, 1) BloomActive's() Goroutine: func (b *bloomcache) BloomActive() bool {
return atomic.LoadInt32(&b.active) != 0
} |
@taylormike does it happen if you put that sleep specifically there? Or does it also work if you put the sleep before the channel close? |
|
Stebalien
added a commit
that referenced
this issue
Aug 6, 2018
Also stop exposing functions that don't do what they claim to do: * Invalidate does, technically invalidate. However, it's not threadsafe. * Rebuild doesn't *clear* the filter so it's only useful for the initial build. It's also not threadsafe. We can restore these functions later if we need them (but we'll have to change a few things to make them work properly). Also adds a `Wait` function to allow waiting for the bloom filter to finish building. fixes #6
Merged
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Moved from: ipfs/kubo#3208
The text was updated successfully, but these errors were encountered: