NIFI-15514: Ensure that Parameter Contexts are assigned to all Proces…#10815
NIFI-15514: Ensure that Parameter Contexts are assigned to all Proces…#10815bbende merged 3 commits intoapache:NIFI-15258from
Conversation
…s Groups in a Connector and not just the top-level group. Ensure that all components are started when Connector starts instead of just Processors and Controller Services - When Working Context is recreated, ensure that we appropriately apply Parameter Context to newly created Process Group(s) - Ensure that when we cleanup unused assets for Connectors that we consider any assets that are referenced in either the Working or Active context instead of just the Active context - Ensure that when we stop Process Group we call all tasks in background threads instead of calling .thenRun which could potentially run in the foreground thread
… are properly configured and notified of any configuration changes when parameters change - Removed the updateParameterContexts from ProcessGroup.updateFlow, which was added in a previous commit as we went a different direction for the fix
| versionedExternalFlow.setParameterContexts(Map.of()); | ||
|
|
||
| destinationGroup.updateFlow(versionedExternalFlow, componentIdSeed, false, true, true); | ||
| final String contextName = sourceGroup.getParameterContext().getName(); |
There was a problem hiding this comment.
Any concern about an NPE here?
Previously line 111 had a check for if (sourceContext != null) { before referencing any field
There was a problem hiding this comment.
In the context of a Connector, the group should always have an implicit Parameter Context so we should be safe here.
| } | ||
| } | ||
| collectReferencedAssetIds(connector.getActiveFlowContext(), referencedAssetIds); | ||
| collectReferencedAssetIds(connector.getWorkingFlowContext(), referencedAssetIds); |
There was a problem hiding this comment.
Since this is called from discardWorkingConfiguration and applyUpdate , wouldn't the working context always have the same references as the active context?
There was a problem hiding this comment.
Yeah, I think you're right. I'm trying to remember the exact reason for this. I know I did it when tracking down a bug in which Assets were being removed when they shouldn't be, and that's resolved here. Given where it's called from it may be that this was not the actual root cause. However, I do believe this is a safer approach, in case it's ever called in the future in a way where that assertion (that active and working have the same reference) does not hold.
bbende
left a comment
There was a problem hiding this comment.
+1 Looks good, ran all system tests
…s Groups in a Connector and not just the top-level group. Ensure that all components are started when Connector starts instead of just Processors and Controller Services
Summary
NIFI-00000
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000VerifiedstatusPull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation