FreeAndNil opened a new issue, #368:
URL: https://github.com/apache/logging-log4net/issues/368

   When another process holds the file lock past `LockTimeoutMillis` while a 
`FileAppender` opens the
   file, the open fails, and every event tries again:
   
   - Each retry waits four times under the appender lock: footer and close of a 
writer that does not
     exist, the open, the header. 40 seconds per event at the default. Since 
3.5.0.
   - With `InterProcessLock`, each retry leaks a `FileStream` until garbage 
collection. Since 3.4.0.
     ANT-2026-D1OOS5L6.
   - With `AppendToFile=false`, each retry truncates the file again.
   - `RollingFileAppender` with `StaticLogFileName=false` adds the roll suffix 
again on every retry:
     `r.log.0`, `r.log.0.0`, `r.log.0.0.0`, one more empty file per dropped 
event.
   
   Proposed fix: footer, close, header and `Flush(int)` return at once when 
there is no open writer,
   and a best-effort lock is not tried again inside an outer one, so a retry 
waits once, for the open
   itself. Dispose the left-over stream on reset. `AppendToFile=false` 
truncates at most once per
   activation; retries append. `RollingFileAppender` retries with its base file 
name. Every event still
   retries, so logging resumes once the other process lets go.
   


-- 
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]

  • [I] A timed-out open waits four ... FreeAndNil (via GitHub) via notifications

Reply via email to