Closed
Description
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