NIFI-16337: Add support for stopping Process Group sources - #11678
Conversation
- add the Stop sources REST endpoint and cluster response handling - expose resolved execution engines on Process Group payloads - add Flow Designer actions for stopping source components - reject STATELESS targets and skip nested STATELESS groups - add backend and frontend test coverage
markap14
left a comment
There was a problem hiding this comment.
Thanks @mcgilman changes make sense to me. I think this is a welcomed minor new feature, and all the changes on the backend look good to me. +1
I don't really have the ability to adequately review the UI code but if one of our more experienced UI folks in the community (@rfellows maybe?) wants to do a quick review of that I'd be supportive of merging.
rfellows
left a comment
There was a problem hiding this comment.
Looked at the Flow Designer bits. The wiring follows the existing start/stop Process Group pattern, resolvedExecutionEngine is the right contract for limited PG visibility, and the menu/effect tests cover the STANDARD vs STATELESS cases well.
Two small nits inline. Context-menu-only (vs the Operation palette) is as-designed from my perspective.
| return resolved === 'STANDARD'; | ||
| }, | ||
| clazz: 'fa fa-stop-circle-o', | ||
| text: 'Stop sources', |
There was a problem hiding this comment.
Sibling items are Title Case (Stop, Empty All Queues, Disable All Controller Services). Would you mind using Stop Sources here so it matches? The new context-menu spec currently asserts the lowercase s, so those strings would need to move with it.
| this.actions$.pipe( | ||
| ofType(FlowActions.stopSources), | ||
| map((action) => action.request), | ||
| switchMap((request) => |
There was a problem hiding this comment.
stopComponent$ uses mergeMap for this same kind of scheduling request. switchMap here will unsubscribe and cancel the in-flight HTTP call if stopSources is dispatched again (double-click, or stopping a child group while a current-group request is still outstanding), while the coordinator may still apply the first request.
concatMap would serialize them; mergeMap would match the stop-component effect. Either is safer than cancelling.
Summary
NIFI-16337
Adds a Stop sources operation for Standard Process Groups. This allows upstream source components to be stopped while downstream components remain running and continue processing queued FlowFiles.
Implementation
PUT /flow/process-groups/{id}/sources.resolvedExecutionEngineon Process Group flow, DTO, and entity payloads.Design and Safety Decisions
Cluster consistency
The coordinator identifies the source components and replicates that fixed component set and its revisions to every node.
Each node independently recalculates its source set and requires exact set equality before scheduling. Set equality is order-independent, so map serialization order does not affect validation. If any node identifies a different set, phase-one validation rejects the request and no node performs the operation.
Authorization
The endpoint authorizes read access to
/flowbefore execution-engine verification or source discovery. It then authorizes the scheduling operation for every requested source before validating the supplied source set.This prevents unauthorized callers from using validation responses to inspect flow state and preserves all-or-nothing component authorization.
Stateless Process Groups
A Stateless target is rejected because its components cannot be scheduled individually through this operation. When a Standard parent contains Stateless descendants, those descendants are skipped and remain running.
Limited Process Group visibility
resolvedExecutionEngineis promoted toProcessGroupEntity, allowing clients to determine whether the operation is supported even when the nested Process Group DTO is omitted because the user cannot read that Process Group.Test Coverage
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000VerifiedstatusPull Request Formatting
mainbranchVerification
Targeted Backend Tests
StandardNiFiServiceFacadeTestTestFlowResourceStopSourcesEndpointMergerTestDtoFactoryTestEntityFactoryTestClustered System Tests
Result: 4 tests passed.
Frontend
npx nx test nifi— 329 test files and 2,831 tests passednpx nx lint nifiStatic Analysis
Build
./mvnw clean install -P contrib-checkLicensing
No new dependencies were introduced.
LICENSEandNOTICEfilesDocumentation
No rendered documentation changes.