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

 ##########
 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:
   I have 0 java experience but based on the code I read, the tmp file was 
created first then the job use java outputSteam to fill the file, 
https://github.com/apache/incubator-hudi/blob/master/hoodie-common/src/main/java/com/uber/hoodie/common/util/SpillableMapUtils.java#L86.
 So trying to catch an exception in the file creation in this PR won't work 
since the file was successfully created and already registered to delete. I 
probably need to catch an exception somewhere 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]


With regards,
Apache Git Services

Reply via email to