Rarasinhoo opened a new pull request, #11913:
URL: https://github.com/apache/nifi/pull/11913

   # Summary
   
   [NIFI-16474](https://issues.apache.org/jira/browse/NIFI-16474)
   
   Loading a flow with `fetchRemoteFlows` fetched nested versioned flows an 
exponential number of times:
   
   - `getFlowContents` called `populateVersionedContentsRecursively` twice for 
every top-level child.
   - `populateVersionedContentsRecursively` fetched each nested flow with 
`fetchRemoteFlows = true`. That fetch loaded the nested flow's own descendants, 
and the loop over its children then fetched them again.
   
   In a chain of three nested versioned flows (`top` → `a` → `b` → `c`), the 
flows were fetched 1, 2, 6 and 18 times, three times more for each level. For 
Git-based registry clients every fetch costs provider API requests. In an 
installation with about 1,200 versioned Process Groups, where most are nested 
in another versioned group, this adds a large share of the requests that 
exhaust the GitHub rate limit.
   
   This change fetches each nested flow without its descendants. The existing 
loop over its children then fetches each descendant exactly once. Parameter 
contexts keep the same precedence: the enclosing flow's context wins over a 
descendant's (`put` for the flow's own, `putIfAbsent` for its children). Child 
snapshots are added to the container as before.
   
   `StandardFlowRegistryClientNodeTest` builds the three-level chain and 
asserts that each flow is fetched once, that the deepest contents are 
populated, that child snapshots are registered and that all parameter contexts 
are collected. The test fails on `main` with `Flow [a] fetched more than once 
==> expected: <1> but was: <2>`.
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [x] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue 
created
   
   ### Pull Request Tracking
   
   - [x] Pull Request title starts with Apache NiFi Jira issue number, such as 
`NIFI-00000`
   - [x] Pull Request commit message starts with Apache NiFi Jira issue number, 
as such `NIFI-00000`
   - [x] Pull request contains [commits 
signed](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits)
 with a registered key indicating `Verified` status
   
   ### Pull Request Formatting
   
   - [x] Pull Request based on current revision of the `main` branch
   - [x] Pull Request refers to a feature branch with one commit containing 
changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request 
creation.
   
   ### Build
   
   - [x] Build completed using `./mvnw clean install -P contrib-check` (on the 
changed module)
     - [x] JDK 21
     - [ ] JDK 25
   
   ### Licensing
   
   - [ ] New dependencies are compatible with the [Apache License 
2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License 
Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` 
files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to