[ 
https://issues.apache.org/jira/browse/SOLR-13601?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18122089#comment-18122089
 ] 

Nick Shanin commented on SOLR-13601:
------------------------------------

🤖 *AI text below* 🤖 *(posted on behalf of Nick Shanin)*

I picked this up intending to add a fallback in ZkController for a node started 
with hostPort 0, but tracing the startup path on current main shows that case 
cannot occur in the standard MiniSolrCloudCluster lifecycle. 
SolrXmlConfig.fillSolrCloudSection() converts any hostPort <= 0 to the 
solr.port.listen system property (or the 8983 default) before CloudConfig is 
constructed, and JettySolrRunner writes the actual bound connector port into 
nodeProperties.hostPort before CoreContainer startup. By the time ZkController 
reads the port it is always a real, already-bound port, so the proposed 
fallback would be dead code. I deleted the branch rather than submit a no-op.

> Allow using 0 port with MiniSolrCloudCluster
> --------------------------------------------
>
>                 Key: SOLR-13601
>                 URL: https://issues.apache.org/jira/browse/SOLR-13601
>             Project: Solr
>          Issue Type: Bug
>          Components: SolrCloud
>            Reporter: Gaël Lalire
>            Priority: Major
>
> I think it works only with changing in ZkController the following line
> {code:java}
> this.localHostPort = cloudConfig.getSolrHostPort();
> {code}
> with this one (to get the real port and not the 0 one)
> {code:java}
> this.localHostPort = 
> Integer.parseInt(cc.getContainerProperties().getProperty("hostPort"));
> {code}
> While it is OK in my case, maybe there is other locations to change.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to