You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "leaves12138 (via GitHub)" <gi...@apache.org> on 2023/04/26 12:40:06 UTC

[GitHub] [incubator-paimon] leaves12138 commented on a diff in pull request #1037: [core][bug] readers don't close while io exception happening

leaves12138 commented on code in PR #1037:
URL: https://github.com/apache/incubator-paimon/pull/1037#discussion_r1177819894


##########
paimon-core/src/main/java/org/apache/paimon/mergetree/MergeTreeReaders.java:
##########
@@ -70,8 +71,14 @@ public static RecordReader<KeyValue> readerForSection(
             MergeFunctionWrapper<KeyValue> mergeFunctionWrapper)
             throws IOException {
         List<RecordReader<KeyValue>> readers = new ArrayList<>();
-        for (SortedRun run : section) {
-            readers.add(readerForRun(run, readerFactory));
+        // if one of the readers creating failed, we need to close them all.
+        try {
+            for (SortedRun run : section) {
+                readers.add(readerForRun(run, readerFactory));

Review Comment:
   done this



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org