Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-6390

Avoid assigning Content Claim to FlowFile if claim has no data

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 1.16.0
    • Core Framework
    • None

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

              markap14 Mark Payne
              markap14 Mark Payne
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h