nick-boss-tech commented on code in PR #5347:
URL: https://github.com/apache/solr/pull/5347#discussion_r4637771923


##########
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##########
@@ -1581,6 +1584,12 @@ Map<String, Object> startSolr(
     if (zkHost != null) {
       command.add("-z");
       command.add(zkHost);
+    } else if (cloudMode) {
+      // this node starts the embedded ZooKeeper, so pass on an explicitly 
configured port
+      Integer embeddedZkPort = SolrZkServer.getConfiguredClientPort();

Review Comment:
   🤖 *AI text below* 🤖
   
   The `zoo.cfg` case is separate. If an example inherits an invalid 
`SOLR_ZOOKEEPER_EMBEDDED_PORT` but includes a valid explicit 
`-Dsolr.zookeeper.embedded.port` argument, `getConfiguredClientPort()` throws 
before `params.extraArgs()` appends that override. A direct `start` applies the 
`-D` to the child, where it can override the environment. Could the example 
resolve the explicit CLI override before validating the inherited setting?



##########
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##########
@@ -668,9 +669,11 @@ void runSecureExample(CloudExampleParams params, boolean 
userManaged) throws Exc
             + serverDir.getParent().toAbsolutePath().normalize());
     Path tls = home.resolve("tls");
     Path include = tls.resolve("solr.in.sh");
-    String zkHost = "localhost:" + (port + 1000);
+    int zkPort = SolrZkServer.resolveClientPort(port);
+    String zkHost = "localhost:" + zkPort;

Review Comment:
   🤖 *AI text below* 🤖
   
   The shipped `server/solr/zoo.cfg` leaves `clientPort` commented out. A 
custom `--server-dir` can supply a copied `zoo.cfg` with `clientPort=2181`, 
though. `RunExampleTool` resolves `zkHost` from the configured/default port, 
while the node’s config takes precedence, so node 1 listens on 2181 and node 2 
and ZooKeeper commands target the resolved port. Could the example use the 
effective endpoint from the copied config or read node 1’s actual endpoint?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to