Github user mohammadshahidkhan commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2517#discussion_r204685081
  
    --- Diff: 
core/src/main/java/org/apache/carbondata/core/fileoperations/AtomicFileOperationsImpl.java
 ---
    @@ -70,12 +78,20 @@ public AtomicFileOperationsImpl(String filePath, 
FileType fileType) {
         if (null != dataOutStream) {
           CarbonUtil.closeStream(dataOutStream);
           CarbonFile tempFile = FileFactory.getCarbonFile(tempWriteFilePath, 
fileType);
    -      if (!tempFile.renameForce(filePath)) {
    -        throw new IOException("temporary file renaming failed, src="
    -            + tempFile.getPath() + ", dest=" + filePath);
    +      if (!this.setFailed) {
    +        if (!tempFile.renameForce(filePath)) {
    +          throw new IOException(
    +              "temporary file renaming failed, src=" + tempFile.getPath() 
+ ", dest=" + filePath);
    +        }
           }
    +    } else {
    +      LOGGER.warn("The temporary file renaming skipped due to I/O error, 
deleting file "
    --- End diff --
    
    @KanakaKumar Thanks for the review. 
    Actually when the delete fails the temp file will persists and its better 
to delete it at the same time, to avoid problem in secure environment.


---

Reply via email to