[
https://issues.apache.org/jira/browse/NIFI-16550?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18139341#comment-18139341
]
ASF subversion and git services commented on NIFI-16550:
--------------------------------------------------------
Commit edbc2ae6ed5d035a48a7965725268ac9f1a5f7c5 in nifi's branch
refs/heads/main from Rob Fellows
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=edbc2ae6ed5 ]
NIFI-16550: Guard Controller Service revision collection against reference
cycles (#11893)
getReferencingComponentRevisions recursed into referencingComponents
without checking referenceCycle. The server currently omits children on
cycle nodes, so recursion ended only because the missing list was
treated as empty. Record the revision of each referencing component as
before, then stop at a cycle node instead of walking its children.
Use the canonical ControllerServiceReferencingComponentEntity type so an
omitted component or children list is handled explicitly, and key the
revision map by the entity id. The NiFiCommon empty check is no longer
needed and is removed.
Add controller-service-state.service.spec.ts covering the service-only
and schedulable walks, including a cycle node that still carries
children and checking the revision value recorded for it.
> Do not recurse into referencing components of a referenceCycle node when
> collecting Controller Service revisions
> ----------------------------------------------------------------------------------------------------------------
>
> Key: NIFI-16550
> URL: https://issues.apache.org/jira/browse/NIFI-16550
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core UI
> Reporter: Rob Fellows
> Assignee: Rob Fellows
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> h2. Problem
> `ControllerServiceStateService.getReferencingComponentRevisions()` in
> `nifi-frontend`
> (`apps/nifi/src/app/service/controller-service-state.service.ts`) builds the
> revision map sent with enable/disable and start/stop requests. It recurses
> into each referencing component's `referencingComponents` without checking
> `referenceCycle`.
> The server (`StandardNiFiServiceFacade`) sets `referenceCycle` on a repeated
> Controller Service and omits its `referencingComponents`, so the recursion
> currently terminates. The client should not rely on the server omitting
> children. A response that sets `referenceCycle` and still includes children
> that loop back would recurse without a bound.
> The reference listing UI already stops at `referenceCycle` nodes. The
> revision collector should do the same.
> h2. Scope
> * In `getReferencingComponentRevisions()`, record the revision of a cycle
> node as usual, but do not recurse into its `referencingComponents` when
> `referenceCycle` is true.
> * Keep the existing empty and missing-children handling.
> h2. Acceptance Criteria
> * A `referenceCycle` node with populated `referencingComponents` does not
> contribute its descendants to the revision map.
> * The cycle node's own revision is still included when it matches the filter
> (Controller Service for service-only, Processor or Reporting Task otherwise).
> * Missing or empty `referencingComponents` still terminate as before.
> * A unit test covers a cycle node with child entries.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)