[GitHub] [hudi] codope commented on a diff in pull request #7437: [HUDI-5366] Closing metadata writer from within writeClient

2022-12-12 Thread GitBox


codope commented on code in PR #7437:
URL: https://github.com/apache/hudi/pull/7437#discussion_r1046736411


##
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java:
##
@@ -1125,6 +1130,14 @@ private HoodieData 
getFilesPartitionRecords(String createInstantTi
 return filesPartitionRecords.union(fileListRecords);
   }
 
+  protected void closeInternal() {
+try {
+  close();
+} catch (Exception e) {

Review Comment:
   AutoCloseable would throw an exception if the resource is not closed. 
However, I think it is better to catch and wrap in HoodieException. Easier to 
search and debug.



-- 
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: commits-unsubscr...@hudi.apache.org

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



[GitHub] [hudi] codope commented on a diff in pull request #7437: [HUDI-5366] Closing metadata writer from within writeClient

2022-12-12 Thread GitBox


codope commented on code in PR #7437:
URL: https://github.com/apache/hudi/pull/7437#discussion_r1046622218


##
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java:
##
@@ -752,6 +752,7 @@ public void 
dropMetadataPartitions(List metadataPartition
   LOG.warn("Deleting pending indexing instant from the timeline for 
partition: " + partitionPath);
   deletePendingIndexingInstant(dataMetaClient, partitionPath);
 }
+closeInternal();
   }
 

Review Comment:
   `HoodieBackedTableMetadataWriter` extends `HoodieTableMetadataWriter` which 
implements `AutoClosable`. But yeah we could create the writer in 
try-with-resource.
   
   +1 for fixing `HoodieFlinkWriteClient` too.



-- 
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: commits-unsubscr...@hudi.apache.org

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