wombatu-kun commented on code in PR #20242:
URL: https://github.com/apache/hudi/pull/20242#discussion_r4226199708


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/bulk/BulkInsertWriteFunction.java:
##########
@@ -120,9 +120,15 @@ public void processElement(I value, Context ctx, 
Collector<RowData> out) throws
   }
 
   @Override
-  public void close() {
-    if (this.writeClient != null) {
-      this.writeClient.close();
+  public void close() throws IOException {
+    try {
+      if (this.writerHelper != null) {
+        this.writerHelper.close();
+      }
+    } finally {

Review Comment:
   If `writeClient.close()` also throws, its exception replaces the helper's 
close failure instead of being attached to it as suppressed. Would 
`IOUtils.closeAll(writerHelper, writeClient)`, as in 
`IndexWriteFunction.close()`, fit better here?



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