mirror of https://github.com/apache/nifi.git
NIFI-366: removed logic to check for invalid ports and throw exception if all ports are invalid. Instead, we will now just run but will be unable to transfer any data; this is preferred anyone because we should still allow the state to be set to transmit, so that when the ports are no longer invalid we can start transmitting immediately.
This commit is contained in:
parent
d8954ab013
commit
e370d7d7e3
|
@ -915,50 +915,6 @@ public class StandardRemoteProcessGroup implements RemoteProcessGroup {
|
||||||
try {
|
try {
|
||||||
verifyCanStartTransmitting();
|
verifyCanStartTransmitting();
|
||||||
|
|
||||||
// Check if any port is invalid
|
|
||||||
boolean invalidPort = false;
|
|
||||||
for (final Port port : getInputPorts()) {
|
|
||||||
if (!port.isValid()) {
|
|
||||||
invalidPort = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!invalidPort) {
|
|
||||||
for (final Port port : getOutputPorts()) {
|
|
||||||
if (!port.isValid()) {
|
|
||||||
invalidPort = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// if any port is invalid, refresh contents to check if it is still invalid
|
|
||||||
boolean allPortsInvalid = invalidPort;
|
|
||||||
if (invalidPort) {
|
|
||||||
try {
|
|
||||||
refreshFlowContents();
|
|
||||||
} catch (final CommunicationsException e) {
|
|
||||||
logger.warn("{} Attempted to refresh Flow Contents because at least one port is invalid but failed due to {}", this, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (final Port port : getInputPorts()) {
|
|
||||||
if (port.isValid()) {
|
|
||||||
allPortsInvalid = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (final Port port : getOutputPorts()) {
|
|
||||||
if (port.isValid()) {
|
|
||||||
allPortsInvalid = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (allPortsInvalid) {
|
|
||||||
throw new IllegalStateException("Cannot Enable Transmission because all Input Ports & Output Ports to this Remote Process Group are in invalid states");
|
|
||||||
}
|
|
||||||
|
|
||||||
for (final Port port : getInputPorts()) {
|
for (final Port port : getInputPorts()) {
|
||||||
// if port is not valid, don't start it because it will never become valid.
|
// if port is not valid, don't start it because it will never become valid.
|
||||||
// Validation is based on connections and whether or not the remote target exists.
|
// Validation is based on connections and whether or not the remote target exists.
|
||||||
|
|
Loading…
Reference in New Issue