Repository navigation
fix(rocksdb): synchronize session close and reset - #3298
Merged
Merged
Conversation
Serialize native batch disposal with cross-thread reset. Skip reset after the session has closed. Cover the disposed-but-registered window with real JNI. Keep retained closed references safe after pool removal.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3298 +/- ##
============================================
+ Coverage 41.71% 41.72% +0.01%
- Complexity 7036 7038 +2
============================================
Files 762 762
Lines 67056 67057 +1
Branches 9020 9021 +1
============================================
+ Hits 27970 27978 +8
+ Misses 35876 35870 -6
+ Partials 3210 3209 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
contrueCT
marked this pull request as draft
October 9, 2026 13:52
This was referenced Oct 9, 2026
contrueCT
marked this pull request as ready for review
October 10, 2026 04:37
imbajin
approved these changes
Oct 10, 2026
imbajin
left a comment
Member
There was a problem hiding this comment.
Blocking: no. Summary: Session close and reset are serialized, and reset safely skips a retained session after its native batch is closed. Evidence: exact-head source review and successful latest-head CI workflows. Score: 8.6/10.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of the PR
A request can dispose its native WriteBatch while its session is still registered in the pool. Concurrent graph truncation can retain that session and call
reset()on the released native owner. Serialize close/reset and skip reset once the session is closed.Addresses the native close/reset item already tracked in #3242 and the original review. The release checklist stays open. Existing #3293 handles snapshot recovery and #3294 handles general lease/scan/RPC cleanup; neither currently fixes this batch disposal/reset interleaving.
Main Changes
Verifying these changes
RocksDBSessionsTest: 20 tests pass on Java 17 with the standard JNI, with no failures/errors/skips.Reset touched a disposed native batch. The fixture traps the invalid access before JNI; it does not intentionally crash the JVM.git diff --checkpass.Real Topling JNI execution was not repeated on this macOS arm64 host; the shared session implementation is exercised with the standard runtime.
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODODoc - DoneDoc - No Need: internal synchronization repair; no configuration or API contract changes.