Skip to content

Windows log rotation errors with active readers #40999

@cpuguy83

Description

@cpuguy83

On Windows, when the daemon attempts to rotate logs, if there is an active reader, the rotation fails.
This failure was totally unrecoverable until #40920
However that PR only allows the daemon to recover after an error.

The issue occurs when the daemon tries to rename a file that a log reader (e.g. docker logs client) has open.
This should have, based on the best info I've found, been fixed by using FILE_SHARE_DELETE (#39974), however that does not seem to be the case.
Furthermore, I've tried to apply this same change to all file opens in that package and still hit the same issue.

What this means right now is that if there is a docker logs client open and log rotation is enabled, if a file is ready for rotation then log writes will error out until the log client is gone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions