NIFI-4205: Avoid duplicated data from TailFile

Before this fix, it is possible that TailFile to produce duplicated data
if an already tailed file has newer timestamp and fewer or the same
amout of data.

Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes #2021.
This commit is contained in:
Koji Kawamura 2017-07-19 22:18:17 +09:00 committed by Pierre Villard
parent 1f330b4fe4
commit b4e0a6e206
1 changed files with 1 additions and 2 deletions

View File

@ -689,8 +689,7 @@ public class TailFile extends AbstractProcessor {
// Check if file has rotated // Check if file has rotated
if (rolloverOccurred if (rolloverOccurred
|| (timestamp <= file.lastModified() && length > file.length()) || (timestamp <= file.lastModified() && length > file.length())) {
|| (timestamp < file.lastModified() && length >= file.length())) {
// Since file has rotated, we close the reader, create a new one, and then reset our state. // Since file has rotated, we close the reader, create a new one, and then reset our state.
try { try {