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


##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/serializer/MergeIterator.java:
##########
@@ -57,10 +57,15 @@ public MergeIterator(Iterator<T> originIterator,
 
     @Override
     public void close() throws Exception {
-        for (Iterator<R> iter : this.iterators) {
-            if (iter instanceof AutoCloseable autoCloseable) {
-                autoCloseable.close();
+        try {
+            for (Iterator<R> iter : this.iterators) {

Review Comment:
   ⚠️ **Important:** If a child close throws, this loop stops and later child 
iterators remain open. If closing the origin also fails, the finally block 
masks the first exception. Please attempt all closes and retain subsequent 
failures as suppressed exceptions; add a failure-path regression test.



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