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

make FilePositionEntry thread-safe #1966

Closed
wants to merge 1 commit into from

Conversation

kazegusuri
Copy link
Contributor

ref #1804 and #1963

fluent-plugin-protometheus calls FilePositionEntry#read_pos and FilePositionEntry#read_inode by using instance_variable_get to get current position and inode as metrics. I understand it is unsupported use.
FilePositionEntry's methods are not thread-safe because each methods share @file to read data from file. So race happens between in_tail plugin and fluent-plugin-protometheus plugin.
But now I found instance variable @pe of Fluent::Plugin::TailInput::TailWatcher is accessible by outside. So I think it is better to be thread-safe to use FilePositionEntry without considering my usecase.
How do you think?

@kazegusuri
Copy link
Contributor Author

Oh, part of tests failed. Is is flaky?

@repeatedly repeatedly closed this Jun 13, 2018
@repeatedly
Copy link
Member

Closed by other PR.

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.

2 participants