imbajin commented on code in PR #3456:
URL: https://github.com/apache/hugegraph/pull/3456#discussion_r4505017187


##########
hugegraph-commons/hugegraph-common/src/main/java/org/apache/hugegraph/iterator/BatchMapperIterator.java:
##########
@@ -43,6 +43,12 @@ public BatchMapperIterator(int batch, Iterator<T> origin,
         this.batchIterator = null;
     }
 
+    @Override
+    public void close() throws Exception {
+        this.resetBatchIterator();

Review Comment:
   ⚠️ **Important:** If closing the current batch throws, this call exits 
before `super.close()`, leaving a closeable origin iterator open. Please close 
the origin even on batch-close failure and preserve both exceptions if both 
closes fail. The current failure test uses a non-closeable origin, so it does 
not cover this resource leak.



-- 
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]

Reply via email to