From 9208d056ef98e7ba7362f60c16eeb74b5a1e53e7 Mon Sep 17 00:00:00 2001 From: Joe Gresock Date: Thu, 23 Mar 2023 13:13:22 -0400 Subject: [PATCH] NIFI-11330: Restarting service referenced by parameter only when service is active (#7078) --- .../StandardVersionedComponentSynchronizer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/flow/synchronization/StandardVersionedComponentSynchronizer.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/flow/synchronization/StandardVersionedComponentSynchronizer.java index bca7d81c84..a18d8e017a 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/flow/synchronization/StandardVersionedComponentSynchronizer.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/flow/synchronization/StandardVersionedComponentSynchronizer.java @@ -1555,9 +1555,12 @@ public class StandardVersionedComponentSynchronizer implements VersionedComponen final Set referencingServices = referenceManager.getControllerServicesReferencing(parameterContext, paramName); for (final ControllerServiceNode referencingService : referencingServices) { + final boolean isServiceActive = referencingService.isActive(); stopControllerService(referencingService, null, timeout, synchronizationOptions.getComponentStopTimeoutAction(), componentsToRestart, servicesToRestart, synchronizationOptions); - servicesToRestart.add(referencingService); + if (isServiceActive) { + servicesToRestart.add(referencingService); + } } }