Opened 8 years ago

Closed 8 years ago

#834 closed defect (not a bug)

Locking issue in DecayingBloomFilter

Reported by: Zlatin Balevsky Owned by:
Priority: minor Milestone:
Component: api/utils Version: 0.9.4
Keywords: locking Cc: Zlatin Balevsky
Parent Tickets: Sensitive: no


In DecayingBloomFilter: add() → (acquires read lock) → locked_add → BloomSHA1.locked_add

But the latter does not have any kind of locking. So the internal state of BloomSHA1 is modified under a read lock.


Change History (2)

comment:1 Changed 8 years ago by zzz

I think it's right as-is. To clarify:

In DBF, the write lock is taken only when switching the double buffers. The read lock is taken for "normal" reads and writes.

In BloomSHA1, there's javadocs at the top that explain how it was rewritten to be thread-safe. The locked_xxx method names in there are leftover from before the rewrite.

comment:2 Changed 8 years ago by zzz

Resolution: not a bug
Status: newclosed
Note: See TracTickets for help on using tickets.