In that case a warning is logged and parsing continued.
Warning makes sense, as it could be due to problems with the
file system, which an operator can do something about.
The history file implementation in `DescriptorReader` writes the
history file passed in `setExcludeFiles()` immediately after reading
and parsing the last descriptor and putting it into the queue,
regardless of whether the application has finished processing those
descriptors.
If the application fails after the history file is written, it may not
be able to process descriptors in the next execution that have still
been in the queue at the time of failing.
This commit deprecates the `setExcludeFiles()` method and replaces it
by a `setHistoryFile()` and a `saveHistoryFile()` method.
Applications would use `setHistoryFile()` before starting to read
descriptors, process all descriptors, perform any cleaning up, and
then call `saveHistoryFile()`.
Implements #20521.
When we recently switched from System.err printing to slf4j logging,
we started logging an IOException that we shouldn't be running into
and that we simply ignored before. This exception gets thrown when
DescriptorReaderImpl attempts to read a parse history file that
doesn't exist (yet). We should simply check whether that files exists
before attempting to read it.
Fixes#20320.
Tests use logback; runtime will use whatever slf4j implementation supplied.
Also removed TODOs about testing, b/c this is noticeable in our coverage report.
We're parsing dates from the CollecTor's Apache directory listings to
decide whether or not to fetch a remote file. The CollecTor host was
recently upgraded from wheezy to jessie, which apparently changed the date
format from dd-MMM-yyyy to yyyy-MM-dd. Adapt to this change.
Obviously, parsing dates like this is very fragile. We should soon switch
to using CollecTor's index.json file instead, ideally before the next
release.