Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in_tail: Work around "undeletable file" issue on Windows #2141

Merged
merged 1 commit into from
May 4, 2020

Conversation

fujimotos
Copy link
Member

Windows will not actually delete a file as long as there is any
open handler for it. Until we close the last open handler, the
file is kept alive as "pending delete".

Obviously this has been breaking the log rotation mechanism for
some users. Work arount that by checking the "DeletePending" flag
manually in tail_fs_check().

Signed-off-by: Fujimoto Seiji fujimoto@ceptord.net

Windows will not actually delete a file as long as there is any
open handler for it. Until we close the last open handler, the
file is kept alive as "pending delete".

Obviously this has been breaking the log rotation mechanism for
some users. Work arount that by checking the "DeletePending" flag
manually in tail_fs_check().

Signed-off-by: Fujimoto Seiji <fujimoto@ceptord.net>
@farcop
Copy link

farcop commented Apr 30, 2020

Solves #2133

@edsiper edsiper merged commit d9d3d49 into fluent:master May 4, 2020
@edsiper
Copy link
Member

edsiper commented May 4, 2020

thanks @fujimotos and @farcop !

edsiper pushed a commit that referenced this pull request May 11, 2020
Windows will not actually delete a file as long as there is any
open handler for it. Until we close the last open handler, the
file is kept alive as "pending delete".

Obviously this has been breaking the log rotation mechanism for
some users. Work arount that by checking the "DeletePending" flag
manually in tail_fs_check().

Signed-off-by: Fujimoto Seiji <fujimoto@ceptord.net>
@fujimotos fujimotos deleted the sf/win32-pending-delete branch May 13, 2020 08:25
@andrerca
Copy link

andrerca commented Jun 19, 2023

Hello,

i'm with the same error when fluent-bit 2.1.2 is in different server, reading *.json files from an network share, on Windows.
File is marked for deletion by log rotate, but it will remain in system if fluent-bit is still running, no matter how old the file is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants