You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Dayakar Morem (Jira)" <ji...@apache.org> on 2020/02/04 06:09:00 UTC

[jira] [Assigned] (NIFI-6923) If FlowFile content is truncated in the Content Repository, NiFi does not throw Exception when reading the content

     [ https://issues.apache.org/jira/browse/NIFI-6923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dayakar Morem reassigned NIFI-6923:
-----------------------------------

    Assignee: Mark Payne  (was: Dayakar Morem)

> If FlowFile content is truncated in the Content Repository, NiFi does not throw Exception when reading the content
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: NIFI-6923
>                 URL: https://issues.apache.org/jira/browse/NIFI-6923
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>            Reporter: Mark Payne
>            Assignee: Mark Payne
>            Priority: Major
>             Fix For: 1.11.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> If the content of a FlowFile is truncated in the Content Repository, whenever NiFi attempts to read the content, it should throw a ContentNotFoundException because only part of the content was available. This is handled by the `FlowFileAccessInputStream` in the `ensureAllContentRead` method.
> However, in some cases this doesn't happen. To replicate, create the following flow:
> GenerateFlowFile -> MergeContent.
> In GenerateFlowFile, choose to use a batch size of 1000 FlowFiles, each 1 KB in size. Run the Processor once. Then, use vi to truncate a few bytes from the end of the file in the content repository. Then, run MergeContent. The processor *should* throw an Exception but doesn't.
> I think the problem is that the `FlowFileAccessInputStream.read(byte[])` calls `super.read(byte[])`. This, in turn, calls `FlowFileAccessInputStream.read(byte[], int, int)`, which increments `bytesConsumed`. This method then returns, as does the super call. Then, the `FlowFileAccessInputStream.read(byte[])` call increments `bytesConsumed` again.
> Instead, the InputStream should just delegate to `read(byte[], int, int)` directly when `read(byte[])` is called instead of delegating to `super.read(byte[], int, int)`.



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