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

StandardProcessSession error - hashmap counter overwritten in highThroughputSession

    XMLWordPrintableJSON

    Details

      Description

      The error is present until version 1.9.2 and earlier in the class StandardProcessSession.java

      The error is on line 3383 in the following code block:

      if (session.countersOnCommit != null)

      { this.countersOnCommit.putAll(session.countersOnCommit); }

      The putALL method is called and the values ​​are not being mixed when it comes to existing keys
      As we know hashmap does not allow duplicate keys. So when we merge the maps in this way, for duplicate keys in map1 the value is overwitten by value for same key in map2.
      This replacement causes the counters to be overwritten when highThroughputSession is activated.This situation only happens if the flag "immediately" is false in the call at method adjustCounter, since in this way the counters are adjusted in the commit and stored in each checkpoint.
      I leave a video showing the error and the request for changes in git with the solution in the code that I propose:

      Nifi Bug StandardProcessSession error - hashmap counter overwritten in highThroughputSession

      This video shows a comparison between version 1.9.2 and the version that I compiled with the fix myself:

      NIFI-6800 - FIX -hashmap counter overwritten in highThroughputSession

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ivan1221 Iván Ezequiel Rodriguez
                Reporter:
                ivan1221 Iván Ezequiel Rodriguez
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m