-
Notifications
You must be signed in to change notification settings - Fork 574
New tail_mode and stat_poll_interval settings to support not keeping file handles permanently open #4075
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
base: master
Are you sure you want to change the base?
New tail_mode and stat_poll_interval settings to support not keeping file handles permanently open #4075
Conversation
|
@david-garcia-garcia: There are no 'kind' label on this PR. You need a 'kind' label to generate the release automatically.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
|
@david-garcia-garcia: There are no area labels on this PR. You can add as many areas as you see fit.
DetailsI am a bot created to help the crowdsecurity developers manage community feedback and contributions. You can check out my manifest file to understand my behavior and what I can do. If you want to use this for your project, you can check out the BirthdayResearch/oss-governance-bot repository. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4075 +/- ##
==========================================
+ Coverage 63.10% 63.19% +0.09%
==========================================
Files 472 475 +3
Lines 33458 33610 +152
==========================================
+ Hits 21113 21240 +127
- Misses 10224 10243 +19
- Partials 2121 2127 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
/kind enhancement |
|
Thanks for the PR! We're close to releasing 1.7.4, so this won't be merged before 1.7.5. As you can see from the last few commits in the master branch, we are For reference, the journalctl datasource is already migrated and merged; syslog Since your PR is a wrapper around the tail package there shouldn't be a lot of conflicts Thanks again for your work and your patience! |
# Conflicts: # pkg/acquisition/modules/file/run.go
|
@mmetc I see that file acquisition has not been upgraded yet. I did a quick attempt here #4280 but the underlying library used for tail does not support context. I am thiking it could be more straightforward to replace that tail library with a custom made one that optionally supports the behaviour that this PR attempts to support. |
|
A cross platform tail rewrite would be tricky. I think it's easier to wrap tomb behavior around context. What do you think @blotus |
|
I took a look at the library used and the implementation was not that big, plus it had several features that we are not using so it could be further simplified. Attempted to fully replace it here: |
Fixes #4074
This PR adds two new configuration options:
To avoid introducing regresions, I built an abstraction to wrap the actual tail implementation depending on tail_mode. When using tail_mode the previous implementation used. When using tail_mode=stat, a new tail implementation that does not permamently keep the file handle open is used.