Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ public class RunNiFi {
public static final String PING_CMD = "PING";
public static final String DUMP_CMD = "DUMP";

private static final int UNINITIALIZED_CC_PORT = -1;

private volatile boolean autoRestartNiFi = true;
private volatile int ccPort = -1;
private volatile int ccPort = UNINITIALIZED_CC_PORT;
private volatile long nifiPid = -1L;
private volatile String secretKey;
private volatile ShutdownHook shutdownHook;
Expand Down Expand Up @@ -1337,6 +1339,12 @@ void setAutoRestartNiFi(final boolean restart) {
}

void setNiFiCommandControlPort(final int port, final String secretKey) throws IOException {

if (this.secretKey != null && this.ccPort != UNINITIALIZED_CC_PORT) {
defaultLogger.warn("Blocking attempt to change NiFi command port and secret after they have already been initialized. requestedPort={}", port);
return;
}

this.ccPort = port;
this.secretKey = secretKey;

Expand Down