Description
In src/Servy.Core/IO/RotatingStreamWriter.cs (lines 374-409), if log rotation fails permanently (e.g., UnauthorizedAccessException on network paths), the writer is left as null. The next write re-creates the writer on the same oversized file, triggering the rotation check again — and failing again. This creates an infinite loop of failed rotations on every log line.
Impact
CPU overhead on every log write after a permanent rotation failure. Log file grows unbounded.
Suggested fix
Set a _rotationDisabled flag after permanent failure and log a warning.
Description
In
src/Servy.Core/IO/RotatingStreamWriter.cs(lines 374-409), if log rotation fails permanently (e.g., UnauthorizedAccessException on network paths), the writer is left as null. The next write re-creates the writer on the same oversized file, triggering the rotation check again — and failing again. This creates an infinite loop of failed rotations on every log line.Impact
CPU overhead on every log write after a permanent rotation failure. Log file grows unbounded.
Suggested fix
Set a
_rotationDisabledflag after permanent failure and log a warning.