kumaab commented on code in PR #277:
URL: https://github.com/apache/ranger/pull/277#discussion_r1296649680
##########
agents-audit/src/main/java/org/apache/ranger/audit/utils/AbstractRangerAuditWriter.java:
##########
@@ -262,10 +263,14 @@ public PrintWriter createWriter() throws Exception {
}
if (logWriter == null) {
- // Create the file to write
- logger.info("Creating new log file. auditPath=" + fullPath);
- createFileSystemFolders();
- ostream = fileSystem.create(auditPath);
+ if (reUseLastLogFile){
+ ostream = fileSystem.append(auditPath);
Review Comment:
@mneethiraj
I observed this while testing the patch: In case of write failures, flush()
is never called (as stream becomes null) ensuring writes to audit log are
atomic in nature(always complete json). The switch happens to spool file for
the writes which don't go through and then when the destination is up again
content from spool is written back to it.
--
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]