adoroszlai commented on code in PR #1237:
URL: https://github.com/apache/ratis/pull/1237#discussion_r1999073961
##########
ratis-common/src/main/java/org/apache/ratis/util/AtomicFileOutputStream.java:
##########
@@ -60,7 +60,7 @@ public AtomicFileOutputStream(File outFile) throws
IOException {
}
public AtomicFileOutputStream(File outFile, File tmpFile) throws IOException
{
- super(FileUtils.newOutputStreamForceAtClose(tmpFile,
StandardOpenOption.CREATE, StandardOpenOption.WRITE));
+ super(FileUtils.newOutputStreamForceAtClose(tmpFile,
StandardOpenOption.CREATE_NEW, StandardOpenOption.WRITE));
Review Comment:
If we allow the file to exist, at least we should truncate it. Otherwise
leftover content may be included in the final file.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]