hnswlib icon indicating copy to clipboard operation
hnswlib copied to clipboard

deadlock when add duplicated labels by multithreads

Open cdjingit opened this issue 1 year ago • 2 comments

Hello, everyone,

Some labels are duplicate in our case. We add labels by multi-thread. I found thread may lock the same mutex two times in one addPoint which lead to deadlock. The first time to lock mutex at here: https://github.com/nmslib/hnswlib/blob/master/hnswlib/hnswalg.h#L1021 The second time to lock the same mutex at here: https://github.com/nmslib/hnswlib/blob/master/hnswlib/hnswalg.h#L185

cdjingit avatar Sep 20 '22 13:09 cdjingit

Hi @cdjingit! Thank you for reporting it. Do you have an example to reproduce it?

dyashuni avatar Sep 20 '22 18:09 dyashuni

@cdjingit I reproduced the issue. I will take a look at this.

dyashuni avatar Nov 26 '22 13:11 dyashuni