hudi-agent commented on code in PR #19482:
URL: https://github.com/apache/hudi/pull/19482#discussion_r3702890136


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/format/cdc/CdcImageManager.java:
##########
@@ -105,13 +110,26 @@ private ExternalSpillableMap<String, byte[]> 
loadImageRecords(
         serializer.serialize(row, new BytesArrayOutputView(baos));
         imageRecordsMap.put(recordKey, baos.toByteArray());
       }
+    } catch (IOException | RuntimeException | Error e) {
+      closeSuppressing(imageRecordsMap, e);
+      throw e;
     }
     return imageRecordsMap;
   }
 
+  private static void closeSuppressing(
+      ExternalSpillableMap<String, byte[]> imageRecordsMap,

Review Comment:
   🤖 nit: the parameter `imageRecordsMap` leaks the call-site context into what 
is otherwise a generic close-and-suppress helper — could you rename it to 
something like `map` or `spillableMap` to keep the method name and signature 
self-contained?
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



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

Reply via email to