mirror of
https://github.com/apache/nifi.git
synced 2025-02-06 01:58:32 +00:00
NIFI-6653 Change bootstrap port command handling
This closes #3722. Signed-off-by: Andy LoPresto <alopresto@apache.org>
This commit is contained in:
parent
171e37ddda
commit
3686ee2a16
@ -116,8 +116,10 @@ public class RunNiFi {
|
||||
public static final String DUMP_CMD = "DUMP";
|
||||
public static final String DIAGNOSTICS_CMD = "DIAGNOSTICS";
|
||||
|
||||
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;
|
||||
@ -1376,6 +1378,12 @@ public class RunNiFi {
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user