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

If Processor adjusts a counter but does not interact with any FlowFiles, the counter isn't updated

    XMLWordPrintableJSON

Details

    Description

      If a Processor calls `ProcessSession.adjustCounter` and passes `false` for the `immediate` argument, the adjustment for the counter should be maintained by the ProcessSession. Then, when (if) the session is committed, the counter should actually be updated. However, if the Processor never interacts with any FlowFiles (never calls `get()` or `create()`), then the counter never gets updated.

      This appears to be due to the fact that in the `checkpoint` method, `StandardProcessSession` checks if `records.isEmpty()` and if so returns. In such a case, it needs to first ensure that it transfers the counters to the checkpoint before returning.

      Attachments

        Issue Links

          Activity

            People

              s9514171 Hsin-Ying Lee
              markap14 Mark Payne
              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 - 1h 10m
                  1h 10m