Skip to content

Commit b53cf29

Browse files
committed
check in the write lock again to make sure future cache hasn't started
1 parent 1a66b46 commit b53cf29

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

collect/cache/cuckoo.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ func (c *CuckooTraceChecker) Maintain() {
208208
// once the current one is half loaded, we can start using the future one too
209209
if futureLoadFactor == 0 && currentLoadFactor > 0.5 {
210210
c.mut.Lock()
211-
c.future = cuckoo.NewFilter(c.capacity)
211+
if c.future == nil {
212+
c.future = cuckoo.NewFilter(c.capacity)
213+
}
212214
c.mut.Unlock()
213215
}
214216

0 commit comments

Comments
 (0)