You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "Mark Payne (JIRA)" <ji...@apache.org> on 2019/02/22 13:36:00 UTC
[jira] [Commented] (NIFI-6068) StandardFunnel looping excessively
[ https://issues.apache.org/jira/browse/NIFI-6068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16775144#comment-16775144 ]
Mark Payne commented on NIFI-6068:
----------------------------------
Thanks for reporting this [~devriesb]. I think your suggestion makes sense. I would probably limit it to something like 1,000 or 10K FlowFiles rather than 100K. 10K is the number of FlowFiles in a single swap file, when swapping is active, so using 100,000 could potentially hold that thread for quite a long time as well. It is interesting that LocalPort does not loop at all, only funnels. It probably makes sense to give them both the same logic, since their intent is really to just move FlowFiles from an incoming queue to an outgoing queue.
> StandardFunnel looping excessively
> ----------------------------------
>
> Key: NIFI-6068
> URL: https://issues.apache.org/jira/browse/NIFI-6068
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 1.9.0
> Reporter: Brandon DeVries
> Priority: Major
>
> The StandardFunnel, when triggered, reads up to 100 FlowFiles at a time and writes them to the outgoing relationship. It does this inside of a loop, with the only exit conditions being:
> # No FlowFiles read (input queue empty)
> # No Available relationships to transfer to
> It does this using a thread from the timer driven thread pool. Unfortunately, this means that a flow can be created such that a constant trickle of data will prevent processors from running, as all threads are in use by funnels which will never let them go.
> To fix this, I'd suggest adding 2 checks. First, if session.get(100) returns fewer than 100 FlowFiles, transfer those files and then return. Essentially, while more files may subsequently come in, at that point the queue had been emptied.
> Second, put a cap on the number of FlowFiles transferred per call to onTrigger. While there may still be files to move downstream, after you've transferred 100K or so it might be time to give up the thread.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)