From b95a82f4a516249f240075e3c402655be70106ca Mon Sep 17 00:00:00 2001 From: Mark Payne Date: Wed, 23 Mar 2016 11:19:31 -0400 Subject: [PATCH] NIFI-1676: Do not allow Processor to be started if state is STOPPING; ensure that it is STOPPED --- .../org/apache/nifi/controller/StandardProcessorNode.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 3fa85e98fe..8ac82a09a4 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 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();