giovannifumarola commented on a change in pull request #1998:
URL: https://github.com/apache/iceberg/pull/1998#discussion_r549445722



##########
File path: 
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveTableOperations.java
##########
@@ -367,6 +363,20 @@ private long acquireLock() throws UnknownHostException, 
TException, InterruptedE
     return lockId;
   }
 
+  private void cleanupMetadataAndUnlock(boolean errorThrown, String 
metadataLocation, Optional<Long> lockId) {
+    try {
+      if (errorThrown) {
+        // if anything went wrong, clean up the uncommitted metadata file
+        io().deleteFile(metadataLocation);
+      }
+    } catch (RuntimeException e) {
+      LOG.error("Fail to cleanup metadata file at {}", metadataLocation, e);
+      throw e;

Review comment:
       Not a fan of Throw within a Catch.
   Maybe you can wrap it in something else.
   




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

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