This is an automated email from the ASF dual-hosted git repository. aboda pushed a commit to branch NIFIREG-371-RC1 in repository https://gitbox.apache.org/repos/asf/nifi-registry.git
commit ff54171455e5ff64526e4f465de9e90352d5fac4 Author: Kevin Doran <[email protected]> AuthorDate: Wed Sep 11 17:07:29 2019 -0400 NIFIREG-318 Change bootstrap port command handling --- .../org/apache/nifi/registry/bootstrap/RunNiFiRegistry.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nifi-registry-core/nifi-registry-bootstrap/src/main/java/org/apache/nifi/registry/bootstrap/RunNiFiRegistry.java b/nifi-registry-core/nifi-registry-bootstrap/src/main/java/org/apache/nifi/registry/bootstrap/RunNiFiRegistry.java index c3bc172..e7a46b7 100644 --- a/nifi-registry-core/nifi-registry-bootstrap/src/main/java/org/apache/nifi/registry/bootstrap/RunNiFiRegistry.java +++ b/nifi-registry-core/nifi-registry-bootstrap/src/main/java/org/apache/nifi/registry/bootstrap/RunNiFiRegistry.java @@ -99,8 +99,10 @@ public class RunNiFiRegistry { 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 autoRestartNiFiRegistry = true; - private volatile int ccPort = -1; + private volatile int ccPort = UNINITIALIZED_CC_PORT; private volatile long nifiRegistryPid = -1L; private volatile String secretKey; private volatile ShutdownHook shutdownHook; @@ -1178,6 +1180,12 @@ public class RunNiFiRegistry { } void setNiFiRegistryCommandControlPort(final int port, final String secretKey) throws IOException { + + if (this.secretKey != null && this.ccPort != UNINITIALIZED_CC_PORT) { + defaultLogger.warn("Blocking attempt to change NiFi Registry command port and secret after they have already been initialized. requestedPort={}", port); + return; + } + this.ccPort = port; this.secretKey = secretKey;
