-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Race condition with approximate query leading to Index has already been closed exception #2262
Labels
bug
Something isn't working
Comments
Proposed Solutions
|
Sample solution:
|
kotwanikunal
changed the title
[BUG] Race condition with approximate query leading to Index has already been closed exception.
[BUG] Race condition with approximate query leading to Index has already been closed exception
Nov 8, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the bug?
There is a race condition in the current code path for the native memory cache manager. An entry from the NativeMemoryCacheManager can be evicted before being read for the query, resulting in an "Index has already been closed" exception.
The issue stems from the current code flow, which acquires a read lock after the entry is loaded into the cache. This disjoint between loading and locking operations creates a window where the cache can evict the entry before the read lock is acquired.
Code References
Load to cache: KNNWeight.java#L286-L302
Read Lock: KNNWeight.java#L313
Exception: KNNWeight.java#L316-L318
How can one reproduce the bug?
The error is reproducible with force eviction turned on along with running a OSB vectorsearch benchmark with 5+ clients
What is the expected behavior?
What is your host/environment?
The text was updated successfully, but these errors were encountered: