Skip to content

A timed-out open waits four times per event and renames on retry #368

Closed

Description

@FreeAndNil

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.
    ANT-2026-VPDB2R3O.

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.

Activity

  1. added this to the 3.6.1 milestone on Nov 20, 2026
  2. self-assigned this
    on Nov 20, 2026
  3. added 5 commits that reference this issue on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions