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

This commit is contained in:
Mark Payne 2016-03-23 11:19:31 -04:00
parent 423b333b71
commit b95a82f4a5
1 changed files with 3 additions and 2 deletions

View File

@ -1117,8 +1117,9 @@ public class StandardProcessorNode extends ProcessorNode implements Connectable
@Override @Override
public void verifyCanStart(final Set<ControllerServiceNode> ignoredReferences) { public void verifyCanStart(final Set<ControllerServiceNode> ignoredReferences) {
if (this.getScheduledState() == ScheduledState.RUNNING) { final ScheduledState currentState = getPhysicalScheduledState();
throw new IllegalStateException(this + " cannot be started because it is already running"); 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(); verifyNoActiveThreads();