armon / bloomd

C network daemon for bloom filters
http://armon.github.io/bloomd
Other
1.24k stars 112 forks source link

race condition in filtmgr_check_keys #43

Closed thinkiny closed 7 years ago

thinkiny commented 7 years ago

we current use bloomd to filter user browser history, bloomd' check performance is very good, about 300k (24 workers), BUT we recive SIGSEGV sometimes in bloomf_contains, because of there are so many filters, we have to change sata to ssd. yesterday i found filtmgr_check_keys has race condition that cause SIGSEGV, change pthread_rwlock_rdlock(&filt->rwlock); to pthread_rwlock_wrlock(&filt->rwlock);, sloves problem. because thread_safe_fault change sbf->filter,there's tiny change sbf->filter has been read wrong.

forgive my poor engish

armon commented 7 years ago

Fixed in 16a99fd, thanks for reporting!