Closed drbh closed 1 year ago
I have released v2.0.14 which fixes this issue. I really appreciate your sample source code, which made it easy for me to find the cause of this issue.
BTW, I know this sample source code is to reproduce this issue, but just to be sure, there is no need to call build_index and save for every insertion. The functions can be called only once at the end of the insertion as follows.
for i in range(0, nb):
index.insert(vectors[i])
index.build_index()
index.save()
@masajiro wow thank you so much for the quick response and fix, the new release completely resolved my issue 🙏
Thanks again for the great project!
calling
index.build_index
successively seems to cause a file descriptor leak.When calling
insert
andbuild
many times (~120) some file is not closed and this causes ngt to crash. Below is the output of a small test that inserts and builds.This can be reproduced with the following script
Additionally this can also be reproduced in
ngt-rs
here: https://github.com/lerouxrgd/ngt-rs/pull/12I believe this is a file descriptor issue because running
lsof
after eachbuild_index
shows a growing number of open files. Upon further inspection these files are alldev/null
however I am not sure where this file is opened and why it is not closed.Please let me know if I can provide any more information! Thank you for the awesome project!