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

Controller Service references not properly tracked if multiple references from same component

    XMLWordPrintableJSON

    Details

      Description

      The StandardControllerServiceNode keeps track of any references to it via `addReference` and `removeReference` methods. However, if a Processor (or another Controller Service) has two different properties that reference the service, then the references can become incorrect.

      This is due to the fact that when Properties are set for a component, we determine that Property A previously referenced Service 123 but no longer does and call `removeReference` on Service 123. However, if Property B also is referencing Service 123, we have a condition where the Processor is referencing Service 123, but Service 123 does not know about it, because of the call to `removeReference`.

      We should either be storing references as a `List` in `StandardControllerServiceNode` or else should determine whether or not all references have been removed before calling `removeReference`. I suspect that the latter is less error-prone, given that calls to `addReference` currently are idempotent and changing the data structure to a `List` would mean that the method is no longer idempotent.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                AxelSync Alessandro D'Armiento
                Reporter:
                markap14 Mark Payne
              • Votes:
                0 Vote for this issue
                Watchers:
                2 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 - 4h
                  4h