Skip to content

NIFI-15801 Stop processors in synchronizeProcessors before updating#11111

Open
kevdoran wants to merge 2 commits intoapache:mainfrom
kevdoran:NIFI-15801
Open

NIFI-15801 Stop processors in synchronizeProcessors before updating#11111
kevdoran wants to merge 2 commits intoapache:mainfrom
kevdoran:NIFI-15801

Conversation

@kevdoran
Copy link
Copy Markdown
Contributor

@kevdoran kevdoran commented Apr 7, 2026

Summary

NIFI-15801

synchronizeProcessors() calls updateProcessor() which requires the processor to be stopped (setAnnotationData throws IllegalStateException if isRunning). The NiFi REST path stops affected processors before calling synchronizeFlow, but the Connector applyUpdate path does not, exposing this gap.

Stop processors via stopOrTerminate before updateProcessor, matching the single-processor synchronize(ProcessorNode, ...) path. Track stopped processors and restart them in a finally block, matching the pattern used in synchronizeProcessGroupSettings.

Tracking

Please complete the following tracking steps prior to pull request creation.

Issue Tracking

Pull Request Tracking

  • Pull Request title starts with Apache NiFi Jira issue number, such as NIFI-00000
  • Pull Request commit message starts with Apache NiFi Jira issue number, as such NIFI-00000
  • Pull request contains commits signed with a registered key indicating Verified status

Pull Request Formatting

  • Pull Request based on current revision of the main branch
  • 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

  • Build completed using ./mvnw clean install -P contrib-check
    • JDK 21
    • JDK 25

Licensing

  • New dependencies are compatible with the Apache License 2.0 according to the License Policy
  • New dependencies are documented in applicable LICENSE and NOTICE files

Documentation

  • Documentation formatting appears as expected in rendered files

synchronizeProcessors() calls updateProcessor() which requires the
processor to be stopped (setAnnotationData throws IllegalStateException
if isRunning). The NiFi REST path stops affected processors before
calling synchronizeFlow, but the Connector applyUpdate path does not,
exposing this gap.

Stop processors via stopOrTerminate before updateProcessor, matching
the single-processor synchronize(ProcessorNode, ...) path. Track
stopped processors and restart them in a finally block, matching
the pattern used in synchronizeProcessGroupSettings.
stoppedProcessors.add(processor);
}
} catch (final TimeoutException | FlowSynchronizationException e) {
throw new ProcessorInstantiationException(processor.getIdentifier(), e);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the right Exception - we are not attempting to instantiate a Processor here, so I'd not throw ProcessorInstantiatonException, probably FlowSynchronizationException

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I updated this, and as it is a checked exception, I had to add it to the method signature and all callers. Let me know if you are good with this @markap14.

@markap14
Copy link
Copy Markdown
Contributor

Thanks @kevdoran i think all looks good to me now. I'm a +1, happy to merge on successful Github Actions completion.

@kevdoran
Copy link
Copy Markdown
Contributor Author

Thanks @markap14 - I see a couple system test failures, but nothing related to this PR

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.

3 participants