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

SplitRecord can enter infinite loop of Expression Language used to provide value of 0 Records per FlowFile

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.14.0
    • Extensions
    • None

    Description

      The SplitRecord processor allows the user to configure the number of Records in each 'split' FlowFile. The Property uses a Positive Integer Validator to ensure that the value is > 0. However, if Expression Language is used, a value of 0 could still be returned. Or a negative value. For example, if the record.count attribute has a value of 1 and the property is set to:

      ${record.count:divide(2)} 

      The intent would be to split the incoming FlowFile into two equally sized FlowFiles. However, if the input has 1 FlowFile, the result will be a value of (integer division) of 1/2 = 0. So the processor enters an infinite loop, creating a new file for each FlowFile until an IOException is reached due to "Too Many Open Files"

      Attachments

        Issue Links

          Activity

            People

              markap14 Mark Payne
              markap14 Mark Payne
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 1h
                  1h