-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Cherry-pick #21048 to 7.9: Filebeat: Fix random error on harvester close #21056
Conversation
This fixes a race condition when a harvester is closed at the same time that its source file size is being calculated. Before this fix, `Error updating file size` errors are randomly printed, because the file handle becomes closed inside the os.Stat call. (cherry picked from commit af6222d)
Pinging @elastic/integrations-services (Team:Services) |
Pinging @elastic/siem (Team:SIEM) |
💔 Tests FailedExpand to view the summary
Build stats
Test stats 🧪
Test errorsExpand to view the tests failures
Steps errorsExpand to view the steps failures
Log outputExpand to view the last 100 lines of log output
|
…c#21056) This fixes a race condition when a harvester is closed at the same time that its source file size is being calculated. Before this fix, `Error updating file size` errors are randomly printed, because the file handle becomes closed inside the os.Stat call. (cherry picked from commit 918f17a)
Cherry-pick of PR #21048 to 7.9 branch. Original message:
This fixes a race condition when a harvester is closed at the same time that its source file size is being calculated.
Why is it important?
Random
Error updating file size
errors have been reported. Other than that it looks like the bug has no other effect.Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesI have added tests that prove my fix is effective or that my feature worksCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
It's easy to trigger this error by removing the Ticker in
monitorFileSize
and busy loop callingh.updateCurrentSize()
, with a configuration that usesclose_eof
and many files.Logs