mirror of https://github.com/apache/nifi.git
NIFI-1676: Do not allow Processor to be started if state is STOPPING; ensure that it is STOPPED
This commit is contained in:
parent
423b333b71
commit
b95a82f4a5
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue