Repository: nifi
Updated Branches:
  refs/heads/master f7ecb47e2 -> e4b7e4783


NIFI-1676: Do not allow Processor to be started if state is STOPPING; ensure 
that it is STOPPED


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

Branch: refs/heads/master
Commit: b95a82f4a516249f240075e3c402655be70106ca
Parents: 423b333
Author: Mark Payne <[email protected]>
Authored: Wed Mar 23 11:19:31 2016 -0400
Committer: Mark Payne <[email protected]>
Committed: Wed Mar 23 11:31:20 2016 -0400

----------------------------------------------------------------------
 .../java/org/apache/nifi/controller/StandardProcessorNode.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/b95a82f4/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
index 3fa85e9..8ac82a0 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
@@ -1117,8 +1117,9 @@ public class StandardProcessorNode extends ProcessorNode 
implements Connectable
 
     @Override
     public void verifyCanStart(final Set<ControllerServiceNode> 
ignoredReferences) {
-        if (this.getScheduledState() == ScheduledState.RUNNING) {
-            throw new IllegalStateException(this + " cannot be started because 
it is already running");
+        final ScheduledState currentState = getPhysicalScheduledState();
+        if (currentState != ScheduledState.STOPPED && currentState != 
ScheduledState.DISABLED) {
+            throw new IllegalStateException(this + " cannot be started because 
it is not stopped. Current state is " + currentState.name());
         }
 
         verifyNoActiveThreads();

Reply via email to