QuakeWang opened a new pull request, #27: URL: https://github.com/apache/paimon-vector-index/pull/27
## What is the problem? The Java JNI wrappers stored native Rust handles as plain `long` values. `close()` could free the native `Box` while another wrapper method was using the same handle, or a native stream callback could re-enter Java and close the wrapper during an in-flight native call. Rust `catch_unwind` cannot protect against use-after-free or double-free UB. ## What does this PR do? This PR serializes native handle access in `VectorIndexWriter` and `VectorIndexReader` with a private lock, and rejects same-thread reentrant native handle use during JNI calls. It keeps reader searches serialized and does not introduce a broader concurrent reader model. It also adds Java tests for closed wrapper behavior and JNI-backed reentrant close coverage, and runs the new native handle safety test in CI. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
