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

Counters in the Wait/Notify pattern do not work as expected

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Extensions

    Description

      The counters in the Wait/Notify pattern do not work as expected, the way counters are decremented seems to be wrong.
      A simple example to reproduce the issue:
      Let's use only one cache, identified by Release Signal ID "A".
      1) Send 2 signals to cache "A", both with counter named "counter_1".
      2) Also send 1 signal to cache "A" with counter named "counter_2".
      At this state, the cache looks like this:
      counter_1 -> 2
      counter_2 -> 1

      If we send 1 flowfile to the corresponding Wait processor, that looks for "counter_1" in cache "A", after the flowfile passes the Wait processor, the value of "counter_1" gets decremented to 0 instead of 1.
      It can be checked in debug mode. It can also be checked on the UI by sending another flowfile to the Wait processor and checking the value of the counter attributes that get appended to it.

      The problem seems to come from this line in the WaitNotifyProtocol class:

      final long reducedSignalCount = signalCount % requiredCountForPass;

      Attachments

        Activity

          People

            Unassigned Unassigned
            pgyori Peter Gyori
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: