Skip to content

NIFI-16174 - Treat a stateless process group as a single lifecycle unit when starting/stopping a controller service's referencing components - #11515

Open
ncover21 wants to merge 3 commits into
apache:mainfrom
ncover21:NIFI-16174
Open

Conversation

@ncover21

@ncover21 ncover21 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

NIFI-16174

StandardControllerServiceProvider scheduled controller-service referencing processors individually even when they belong to a stateless process group. Because a stateless group is a single scheduling unit, this left the group in a mixed running/stopped state with the group node stuck RUNNING and unable to recover. It surfaces during break-glass/troubleshooting on connectors whose stateless subgroup references a root-scoped controller service.

The start path already skips stateless members (DefaultComponentScheduler.startNow returns early when resolveExecutionEngine() == STATELESS); the stop path (unscheduleReferencingComponents) did not, so it stopped members individually. Simply ignoring stateless members on stop is not sufficient either: a running stateless member reports getPhysicalScheduledState() == RUNNING, so it counts as an active reference in verifyCanDisable, which would then block the controller service from being disabled.

This change treats the owning stateless group as a single unit on both paths:

  • Resolve each referenced processor's owning stateless group (STATELESS -> self, INHERITED -> nearest explicit ancestor).
  • On stop, call ProcessGroup.stopProcessing() once per distinct owning stateless group (its members transition to STOPPED together, so the service can then be disabled), mapping the group's single future to every affected member.
  • On start, call ComponentScheduler.startStatelessGroup() once per distinct owning stateless group, so "enable service and start referencing components" restarts the group.

Standard (non-stateless) referencing components are unchanged, and the public ControllerServiceProvider method signatures are unchanged.

Tracking

  • JIRA issue created: NIFI-16174
  • Commit message prefixed with NIFI-16174
  • main builds on the changed modules (checkstyle + PMD pass)

…it when starting/stopping a controller service's referencing components

StandardControllerServiceProvider scheduled processors that reference a
controller service individually, even when they belong to a stateless process
group. Because a stateless group is a single scheduling unit, this left the
group with a mixed running/stopped processor state and a group node stuck
RUNNING, from which it could not recover.

Resolve each referenced processor's owning stateless group (STATELESS -> self,
INHERITED -> nearest explicit ancestor) and, for stateless members, stop the
group once via ProcessGroup.stopProcessing() / start it once via
ComponentScheduler.startStatelessGroup(), mapping the group's single future to
every affected member. Standard processors are unchanged. Public
ControllerServiceProvider signatures are unchanged.

Adds unit coverage in StandardControllerServiceProviderTest and an end-to-end
regression (ConnectorTroubleshootingIT) backed by a stateless controller-service
reference in the ComponentLifecycleConnector test fixture.
@ncover21
ncover21 marked this pull request as ready for review August 7, 2026 00:52
@ncover21
ncover21 marked this pull request as draft August 7, 2026 16:24
…wning stateless group

A referenced processor's process group can report a null execution engine
(e.g. in unit-test fixtures backed by mock process groups). Treat a null
engine as non-stateless so getStatelessGroup returns null and the processor
is handled on the standard per-component path, rather than throwing an NPE
in the switch.
@ncover21
ncover21 marked this pull request as ready for review August 7, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant