Repository navigation
NIFI-16459: Start and stop each nested processor once when draining a Connector - #110
Conversation
|
[Claude Opus 5.5] I believe this change is correct, but I think there's a simpler way to fix it. When called on the root group, protected CompletableFuture<Void> stopSourceComponents(final FlowContext context) {
final List<CompletableFuture<Void>> stopFutures = new ArrayList<>();
for (final ProcessorFacade sourceProcessor : getSourceProcessors(context.getRootGroup())) {
stopFutures.add(sourceProcessor.getLifecycle().stop());
}
return CompletableFuture.allOf(stopFutures.toArray(new CompletableFuture[0]));
}
protected CompletableFuture<Void> startNonSourceComponents(final FlowContext flowContext) {
final ProcessGroupFacade rootGroup = flowContext.getRootGroup();
final List<CompletableFuture<Void>> startFutures = new ArrayList<>();
for (final ProcessorFacade nonSourceProcessor : getNonSourceProcessors(rootGroup)) {
startFutures.add(nonSourceProcessor.getLifecycle().start());
}
final ProcessGroupLifecycle lifecycle = rootGroup.getLifecycle();
startFutures.add(lifecycle.startPorts(ComponentHierarchyScope.INCLUDE_CHILD_GROUPS));
startFutures.add(lifecycle.startRemoteProcessGroups(ComponentHierarchyScope.INCLUDE_CHILD_GROUPS));
startFutures.add(lifecycle.startStatelessGroups(ComponentHierarchyScope.INCLUDE_CHILD_GROUPS));
return CompletableFuture.allOf(startFutures.toArray(new CompletableFuture[0]));
}In the framework's |
2664620 to
9ffbf5e
Compare
markap14
left a comment
There was a problem hiding this comment.
Thanks @bobpaulin this looks correct. Looks like we were gathering recursively - recursively. Whoops! +1 will merge.
Connector Walking every group level started nested processors more than once. A repeated start never completes, so the Connector stayed DRAINING. Start and stop them once from the root group.
9ffbf5e to
7f08ddd
Compare
Start and stop each nested processor once when draining a Connector
startNonSourceComponents and stopSourceComponents collected processors recursively at every level while also recursing into child groups, so a processor N groups deep was started or stopped N+1 times. A repeated start
of a running processor never completes, which left drainFlowFiles blocked
and the Connector stuck in DRAINING. Each level now visits only its own processors, classified against the root group's connections.
Summary
NIFI-16459
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000Pull Request Formatting
mainbranch