You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2019/07/18 17:45:00 UTC

[GitHub] [incubator-hudi] n3nash commented on a change in pull request #795: HUDI-171 delete tmp file after split merge failure

n3nash commented on a change in pull request #795: HUDI-171 delete tmp file after split merge failure
URL: https://github.com/apache/incubator-hudi/pull/795#discussion_r305039389
 
 

 ##########
 File path: hoodie-common/src/main/java/com/uber/hoodie/common/util/collection/DiskBasedMap.java
 ##########
 @@ -106,7 +106,16 @@ private void initFile(File writeOnlyFileHandle) throws IOException {
     if (!writeOnlyFileHandle.getParentFile().exists()) {
       writeOnlyFileHandle.getParentFile().mkdir();
     }
-    writeOnlyFileHandle.createNewFile();
+    // create the file
+    try {
+      writeOnlyFileHandle.createNewFile();
 
 Review comment:
   This does not make sense to me. If the create failed, why would we catch and then attempt to delete it ? 
   You can fix this in the following way : 
   
   There is already a shutdownHook called -> addShutDownHook(..) in this class. Just add the following line there : 
   
   writeOnlyFileHandle.delete().
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services