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

Funnel with no outgoing connections and a queued Flow File uses high CPU

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3.0
    • 1.4.0
    • Core Framework
    • None

    Description

      I have a simple Flow where a file containing JSON data is read, and converted to Avro.

      However, I have the resulting Avro container file parked in a queue going to a Funnel, and it causes my CPU to spike.

      Emptying the queue causes the CPU to return to normal.

      It seems that in the 'ContinuallyRunConnectableTask' class, it does correctly determine that the Funnel shouldn't be run, but since there is both a FlowFile in queue, and a relaiton, it also decides to not yield.

      I've added both a fix for this (patch to follow), as well as a new unit test to make sure Funnels without outgoing connections get yielded. With the fix, the CPU spiking is gone.

      Attachments

        1. WithFixPrePostCpu.png
          100 kB
          Wesley L Lawrence
        2. NifiPreEmptyHighCpu.png
          65 kB
          Wesley L Lawrence
        3. NifiPostEmptyLowCpu.png
          29 kB
          Wesley L Lawrence
        4. nifi-4064.patch
          8 kB
          Wesley L Lawrence
        5. FlowWithOneFileInQueue.png
          139 kB
          Wesley L Lawrence

        Issue Links

          Activity

            People

              WesleyLawrence Wesley L Lawrence
              WesleyLawrence Wesley L Lawrence
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: