[
https://issues.apache.org/jira/browse/NIFI-8720?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17366742#comment-17366742
]
ASF subversion and git services commented on NIFI-8720:
-------------------------------------------------------
Commit 6fc9f33ba23066afca1f33497829cdc35e3b6d5b in nifi's branch
refs/heads/main from Mark Payne
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=6fc9f33 ]
NIFI-8720: Ensure that when we use Expression Language for Records Per Split
property of SplitRecord, we treat the result as a value of 1 if it's less than
1.
Signed-off-by: Matthew Burgess <[email protected]>
This closes #5171
> SplitRecord can enter infinite loop of Expression Language used to provide
> value of 0 Records per FlowFile
> ----------------------------------------------------------------------------------------------------------
>
> Key: NIFI-8720
> URL: https://issues.apache.org/jira/browse/NIFI-8720
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Reporter: Mark Payne
> Assignee: Mark Payne
> Priority: Major
> Fix For: 1.14.0
>
> Time Spent: 20m
> Remaining Estimate: 0h
>
> 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:
> {code:java}
> ${record.count:divide(2)} {code}
> 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"
--
This message was sent by Atlassian Jira
(v8.3.4#803005)