Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix open file handler issue #2028
If during the start of a harvester and error happens during opening the file, it can happen that the file descriptor is not properly closed. This error was found in 5.x and is fixed in #2020 but applies also all 1.x filebeat versions.
The openFile method must be adjusted so that also in case of an error during the first file checks, the file descriptor is closed properly: https://github.com/elastic/beats/blob/master/filebeat/harvester/log.go#L151