smengcl commented on code in PR #11428:
URL: https://github.com/apache/ozone/pull/11428#discussion_r4255818480
##########
hadoop-hdds/rocks-native/src/main/java/org/apache/hadoop/hdds/utils/db/LatestVersionedKWayMergeIterator.java:
##########
@@ -407,12 +417,27 @@ public RawSstHeapHead next() {
@Override
public void close() {
- if (closed) {
- return;
+ if (iterator != null) {
+ iterator.close();
+ }
+ if (reader != null) {
+ reader.close();
Review Comment:
Can we restore the closed guard here? HeapEntry.advance() closes each source
when it is exhausted, and LatestVersionedKWayMergeIterator.close() closes it
again during cleanup. ManagedRawSSTFileReader.close() unconditionally deletes
the native reader, so removing the guard allows a double-free on normal scan
completion and can abort the JVM.
Please verify exhaustion followed by close over a real SST.
Small suggested diff:
```diff
private final ManagedSlice fromSlice;
private final ManagedSlice toSlice;
+ private boolean closed;
@@
public void close() {
+ if (closed) {
+ return;
+ }
+ closed = true;
if (iterator != null) {
iterator.close();
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]