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

Fluentd fails to rotate supervisor log on Windows #3923

Closed
fujimotos opened this issue Oct 20, 2022 · 1 comment
Closed

Fluentd fails to rotate supervisor log on Windows #3923

fujimotos opened this issue Oct 20, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@fujimotos
Copy link
Member

Describe the bug

I notice another rotate bug while implementing a fix for #3921.

Suppose we launch Fluentd as follows:

PS> fluentd -c fluent.conf -o log/test.log --log-rotate-size=2k

This is perfectly normal settings, but it ends up causing an internal error.
Here is the actual error message:

PS> bundle exec fluentd -c fluentd.conf -o test.log  --log-rotate-size=2k
...
log shifting failed. Permission denied @ rb_file_s_rename - (log/test-supervisor-0.log, log/test-supervisor-0.log.0)
log writing failed. closed stream

To Reproduce

  1. Run the following command on Windows:
    PS> fluentd -c fluent.conf -o log/test.log --log-rotate-size=2k
  2. Observe fluentd outputs error messages to console on rotation.

Expected behavior

No error

Your Environment

- Fluentd version: v1.15.2 (latest HEAD)
- TD Agent version: -
- Operating system: Windows Server 2019
- Kernel version: -

Your Configuration

<source>
  @type dummy
  tag test.log
</source>
<match>
  @type stdout
</match>

Your Error Log

See above.

Additional context

No response

@fujimotos fujimotos added the bug Something isn't working label Oct 20, 2022
@fujimotos
Copy link
Member Author

I don't fully trace the root cause yet, but my strong suspicion is that
the supervisor actually has two separate logger instances (on the same file):

Since Windows locks files with an open handler by default
and there is no coordination between two loggers, they are
conflicting with each other.

@fujimotos fujimotos self-assigned this Oct 20, 2022
@fujimotos fujimotos moved this to To-Do in Fluentd Kanban Oct 20, 2022
Repository owner moved this from To-Do to Done in Fluentd Kanban Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

1 participant