jelmerk / hnswlib

Java library for approximate nearest neighbors search using Hierarchical Navigable Small World graphs
Apache License 2.0
260 stars 56 forks source link

Fixed deadlock on Error #33

Closed nur1popcorn closed 3 years ago

nur1popcorn commented 3 years ago

This patch fixes the deadlock issue referenced in #32

jelmerk commented 3 years ago

Thanks for the PR! I think that mostly makes sense.

The one thing I don't like about this, is that we would silently swallow checked exceptions and errors this way

How about wrapping the exception in a custom runtime exception that extends from com.github.jelmerk.knn.hnsw.IndexException and throwing that instead ?

nur1popcorn commented 3 years ago

Alright I implemented your suggestions tell me if you like the name of the exception.

jelmerk commented 3 years ago

how about UncategorizedIndexException instead

nur1popcorn commented 3 years ago

Ok do you think there is anything else that needs to be changed or is it ready to be merged into the master branch ?

jelmerk commented 3 years ago

nope, all good. thanks for the contribution!