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

StandardFunnel looping excessively

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.9.0
    • 1.10.0, 1.9.1
    • Core Framework
    • None

    Description

      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:

      1. No FlowFiles read (input queue empty)
      2. 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.

      Attachments

        Issue Links

          Activity

            People

              markap14 Mark Payne
              devriesb Brandon Rhys DeVries
              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 - 20m
                  20m