mirror of https://github.com/apache/nifi.git
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:
parent
1f330b4fe4
commit
b4e0a6e206
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue