Skip to content

Fix RAVV thread-local supplier leaks#662

Draft
Trihedron1240 wants to merge 1 commit intodatastax:mainfrom
Trihedron1240:codex/fix-ravv-threadlocal-leak
Draft

Fix RAVV thread-local supplier leaks#662
Trihedron1240 wants to merge 1 commit intodatastax:mainfrom
Trihedron1240:codex/fix-ravv-threadlocal-leak

Conversation

@Trihedron1240
Copy link
Copy Markdown

Summary

  • Fixes RandomAccessVectorValues thread-local supplier cleanup by exposing a closeable supplier path.
  • Closes thread-local copies owned by ExplicitThreadLocal, including copies created during graph build and quantization flows.
  • Adds regression tests proving shared RAVV copies are closed and GraphIndexBuilder releases copied vector values.

Closes #635

Root Cause

RandomAccessVectorValues.threadLocalSupplier() used ExplicitThreadLocal internally but returned only tl::get, so callers had no way to close the thread-local container or the copied vector values it owned. This leaked closeable copies created for shared RAVV implementations.

Validation

  • Before fix: focused regression failed; graph build created 12 RAVV copies and closed 0.
  • After fix: focused regression passed; all created RAVV copies were closed.
  • git diff --check origin/main...HEAD
  • mvn -B verify using local JDK 25
  • mvn -B -Pjdk20 -am -pl jvector-tests test using local JDK 25
  • mvn -B -Pjdk11 -am -pl jvector-tests test using local JDK 25

Notes

The GitHub Actions AVX/native lanes and manual benchmark workflow should still be reviewed on GitHub runner hardware.

@Trihedron1240 Trihedron1240 marked this pull request as ready for review April 25, 2026 09:16
@Trihedron1240 Trihedron1240 marked this pull request as draft April 25, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RandomAccessVectorValues::threadLocalSupplier leaks objects

1 participant