Mark Payne created NIFI-6390:
--------------------------------
Summary: Avoid assigning Content Claim to FlowFile if claim has no
data
Key: NIFI-6390
URL: https://issues.apache.org/jira/browse/NIFI-6390
Project: Apache NiFi
Issue Type: Bug
Components: Core Framework
Reporter: Mark Payne
Assignee: Mark Payne
When a Processor writes to a FlowFile, it creates a Content Claim to write to,
and this Content Claim is assigned a Resource Claim (a file on disk in the case
of the FileSystemRepository). If no data is then written to the FlowFile, the
content claim remains. This means that the FlowFile is now holding a reference
to a Resource Claim that it doesn't really need.
Unfortunately, this can potentially keep data in the Content Repository longer
than it needs to. Take, for example, the case where a FlowFile is created and 0
bytes are written to it. Then, a Processor writes 10 MB to another FlowFile. If
these two FlowFIles hold claims to the same file on disk, then even after the
second FlowFile is destroyed, that 10 MB claim must stay around until the
0-byte FlowFile is also destroyed, because it holds the claim.
Instead, the framework should detect that no data was written to the FlowFile
and destroy the content claim & decrement the claimant count on the Resource
Claim.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)