Repository: nifi
Updated Branches:
  refs/heads/master d319a3ef2 -> 76b0065a6


NIFI-5822: Ensure that we don't call 
FlowController.getControllerServiceProvider() before the 
ControllerServiceProvider has been initialized

This closes #3171.

Signed-off-by: Bryan Bende <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/76b0065a
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/76b0065a
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/76b0065a

Branch: refs/heads/master
Commit: 76b0065a67c0e3270d44d85e1933c41bfaba8841
Parents: d319a3e
Author: Mark Payne <[email protected]>
Authored: Thu Nov 15 12:33:03 2018 -0500
Committer: Bryan Bende <[email protected]>
Committed: Thu Nov 15 13:25:33 2018 -0500

----------------------------------------------------------------------
 .../nifi/controller/scheduling/StandardProcessScheduler.java  | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/76b0065a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
index 6313097..2902f6a 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
@@ -35,7 +35,6 @@ import org.apache.nifi.controller.SchedulingAgentCallback;
 import org.apache.nifi.controller.StandardProcessorNode;
 import org.apache.nifi.controller.exception.ProcessorInstantiationException;
 import org.apache.nifi.controller.service.ControllerServiceNode;
-import org.apache.nifi.controller.service.ControllerServiceProvider;
 import org.apache.nifi.encrypt.StringEncryptor;
 import org.apache.nifi.engine.FlowEngine;
 import org.apache.nifi.logging.ComponentLog;
@@ -72,7 +71,6 @@ public final class StandardProcessScheduler implements 
ProcessScheduler {
 
     private static final Logger LOG = 
LoggerFactory.getLogger(StandardProcessScheduler.class);
 
-    private final ControllerServiceProvider controllerServiceProvider;
     private final FlowController flowController;
     private final long administrativeYieldMillis;
     private final String administrativeYieldDuration;
@@ -92,7 +90,6 @@ public final class StandardProcessScheduler implements 
ProcessScheduler {
     public StandardProcessScheduler(final FlowEngine 
componentLifecycleThreadPool, final FlowController flowController, final 
StringEncryptor encryptor,
         final StateManagerProvider stateManagerProvider, final NiFiProperties 
nifiProperties) {
         this.componentLifeCycleThreadPool = componentLifecycleThreadPool;
-        this.controllerServiceProvider = 
flowController.getControllerServiceProvider();
         this.flowController = flowController;
         this.encryptor = encryptor;
         this.stateManagerProvider = stateManagerProvider;
@@ -296,7 +293,7 @@ public final class StandardProcessScheduler implements 
ProcessScheduler {
     public synchronized CompletableFuture<Void> startProcessor(final 
ProcessorNode procNode, final boolean failIfStopping) {
         final LifecycleState lifecycleState = 
getLifecycleState(requireNonNull(procNode), true);
 
-        final StandardProcessContext processContext = new 
StandardProcessContext(procNode, this.controllerServiceProvider,
+        final StandardProcessContext processContext = new 
StandardProcessContext(procNode, flowController.getControllerServiceProvider(),
             this.encryptor, getStateManager(procNode.getIdentifier()), 
lifecycleState::isTerminated);
 
         final CompletableFuture<Void> future = new CompletableFuture<>();
@@ -336,7 +333,7 @@ public final class StandardProcessScheduler implements 
ProcessScheduler {
     public synchronized CompletableFuture<Void> stopProcessor(final 
ProcessorNode procNode) {
         final LifecycleState lifecycleState = getLifecycleState(procNode, 
false);
 
-        StandardProcessContext processContext = new 
StandardProcessContext(procNode, this.controllerServiceProvider,
+        StandardProcessContext processContext = new 
StandardProcessContext(procNode, flowController.getControllerServiceProvider(),
             this.encryptor, getStateManager(procNode.getIdentifier()), 
lifecycleState::isTerminated);
 
         LOG.info("Stopping {}", procNode);

Reply via email to