When a log file being monitored by the aws-kinesis-agent is (inadvertently) log rotated twice, the following code in TrackedFileRotationAnalyzer.java will assert, causing the agent to stop working (and likely not recover properly due to ungracefully closing down).
Preconditions.checkState(incoming.size() > 1); // always true after rotation by Truncate
Preconditions.checkState(hasCounterpart(incoming.get(0))); // always true for rotation by Truncate
Commenting (or just removing) these two lines will allow the code to properly close down the tailing of a file that has been double log rotated.
// Preconditions.checkState(incoming.size() > 1); // always true after rotation by Truncate
// Preconditions.checkState(hasCounterpart(incoming.get(0))); // always true for rotation by Truncate
When a log file being monitored by the aws-kinesis-agent is (inadvertently) log rotated twice, the following code in TrackedFileRotationAnalyzer.java will assert, causing the agent to stop working (and likely not recover properly due to ungracefully closing down).
Commenting (or just removing) these two lines will allow the code to properly close down the tailing of a file that has been double log rotated.