Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

Commit

Permalink
MINIFI-512 Change bootstrap port command handling
Browse files Browse the repository at this point in the history
  • Loading branch information
kevdoran authored and bbende committed Sep 23, 2019
1 parent 11e6395 commit 55aac22
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,10 @@ public class RunMiNiFi implements QueryableStatusAggregator, ConfigurationFileHo
BOOTSTRAP_KEYS_TO_YML_KEYS = Collections.unmodifiableMap(mutableMap);
}

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 minifiPid = -1L;
private volatile String secretKey;
private volatile ShutdownHook shutdownHook;
Expand Down Expand Up @@ -1562,6 +1564,12 @@ void setAutoRestartNiFi(final boolean restart) {
}

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

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

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

Expand Down

0 comments on commit 55aac22

Please sign in to comment.