Details
-
Bug
-
Resolution: Unresolved
-
Critical
-
None
-
1.2.0
-
None
-
Description
Since v1.2.0 the prudent mode is almost useless because safeWrite never get really invoked
before v1.2.0
// OutputStreamAppender.java try { // skip some irrelevant codes... writeOut(event) } catch (IOException ioe) { this.started = false; addStatus(new ErrorStatus("IO failure in appender", this, ioe)); } // and writeOut is overrided by FileAppender.java @Override protected void writeOut(E event) throws IOException { if (prudent) { safeWrite(event); // here is the point, it ensure write integrity with file lock } else { super.writeOut(event); } }
but since v1.2.0, the code was refactored to this
// OutputStreamAppender.java protected void subAppend(E event) { if (!isStarted()) { return; } try { // skip some irrelevant codes... byte[] byteArray = this.encoder.encode(event); writeBytes(byteArray); // there is no guarantee to safe write } catch (IOException ioe) { this.started = false; addStatus(new ErrorStatus("IO failure in appender", this, ioe)); } }