You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2020/12/18 19:22:00 UTC

[jira] [Commented] (NIFI-8102) TailFile can skip characters if tailing a file on NFS mount

    [ https://issues.apache.org/jira/browse/NIFI-8102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17251963#comment-17251963 ] 

ASF subversion and git services commented on NIFI-8102:
-------------------------------------------------------

Commit 31c5dc5ab41ebf909b7512154e7519d22936bf89 in nifi's branch refs/heads/main from Denes Arvay
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=31c5dc5 ]

NIFI-8102 TailFile can skip characters if tailing a file on NFS mount

- Force the TailFile processor to recreate and reposition the reader
  by setting it to null in case of a NulCharacterEncounteredException
- Updated the TestTailFile.testNULContent() to not initialize the
  processor when calling the second run()

Update the reader's position instead of abandoning it.

This closes #4736.

Signed-off-by: Mark Payne <ma...@hotmail.com>


> TailFile can skip characters if tailing a file on NFS mount
> -----------------------------------------------------------
>
>                 Key: NIFI-8102
>                 URL: https://issues.apache.org/jira/browse/NIFI-8102
>             Project: Apache NiFi
>          Issue Type: Bug
>            Reporter: Denes Arvay
>            Assignee: Denes Arvay
>            Priority: Major
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> As explained in NIFI-7972 on an NFS mount files can have temporary dummy data of {{NUL}} bytes. This was addressed at that Jira but the implementation contains a bug that can lead to characters skipped when encountering NUL bytes.
> The root cause is that the reader ({{FileChannel}}) is not repositioned properly. This wasn't discovered by the newly added unit tests because the second {{run}} call (after the simulated {{NUL}} byte replacement) was also called with {{initialize = true}} parameter, so the respective {{reader}} was reinitalized and repositioned. See [1]
> [1] https://github.com/apache/nifi/blob/main/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestTailFile.java#L198



--
This message was sent by Atlassian Jira
(v8.3.4#803005)