[
https://issues.apache.org/jira/browse/NIFI-6390?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mark Payne updated NIFI-6390:
-----------------------------
Status: Patch Available (was: Open)
> 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
> Priority: Critical
> Labels: easyfix, newbie
> Fix For: 1.16.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> 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
(v8.20.1#820001)