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

Mikael Sterner commented on SOLR-18336:
---------------------------------------

[~janhoy] Neat! I guess it's either that or looking ten lines up in the 
{{solr.cmd}} batch script what arguments were used when launching the process 
the Java code is scanning the whole system to find... ;) (Though in fairness, 
the total {{solr.cmd}} is more than ten lines of complexity.)

> Start command waits for all running Solr processes on Windows
> -------------------------------------------------------------
>
>                 Key: SOLR-18336
>                 URL: https://issues.apache.org/jira/browse/SOLR-18336
>             Project: Solr
>          Issue Type: Bug
>          Components: cli
>    Affects Versions: 10.0
>            Reporter: Mikael Sterner
>            Assignee: Jan Høydahl
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> When using the Solr Control Script to start Solr 10.0.0 on Windows in User 
> Managed mode, it checks the status of all currently running Solr instances by 
> enumerating the PID files:
> {noformat}
> solr-10.0.0-slim\bin\solr.cmd start --user-managed -p 8981
> Waiting up to 180 seconds to see Solr running on port 8981
> Started Solr server on port 8981. Happy searching!
>  
> solr-10.0.0-slim\bin\solr.cmd start --user-managed -p 8982
> Waiting up to 180 seconds to see Solr running on port 8981
> Started Solr server on port 8981. Happy searching!
> Waiting up to 180 seconds to see Solr running on port 8982
> Started Solr server on port 8982. Happy searching!
> {noformat}
> In Solr 9.10.1 it only waits for the specified Solr instance:
> {noformat}
> solr-9.10.1-slim\bin\solr.cmd start -p 8981
> Waiting up to 180 seconds to see Solr running on port 8981
> Started Solr server on port 8981. Happy searching!
>  
> solr-9.10.1-slim\bin\solr.cmd start -p 8982
> Waiting up to 180 seconds to see Solr running on port 8982
> Started Solr server on port 8982. Happy searching!
> {noformat}
> This seems like a regression from SOLR-17685, where the simplified 
> {{solr.cmd}} script no longer passes in {{--solr-url}} to the status tool 
> with commit 
> [fd42ecdcd55|https://github.com/apache/solr/pull/3223/changes/fd42ecdcd55f21e8398a0675a6f479b59fc61405].
>  (This makes it fall back to waiting for all Solr instances found in the PID 
> directory.)
> A naive fix would be to only add {{\-p %SOLR_PORT_LISTEN%}} to the status 
> tool, as in commit 
> [375b5be8fb3|https://github.com/apache/solr/pull/4710/changes/375b5be8fb3c2e796f79826d89985fda3614585a].
>  However, that still feels less robust than {{--solr-url}} as it relies on 
> PID files, and it also doesn't work if running with a non-loopback bind:
> {noformat}
> set SOLR_HOST_BIND=10.0.x.x
> set SOLR_HOST_ADVERTISE=myhost.example.com
> solr-10.0.0-slim\bin\solr.cmd start --user-managed -p 8981
> Waiting up to 180 seconds to see Solr running on port 8981
> ERROR: Solr at http://localhost:8981/solr did not come online within 180 
> seconds!
> ERROR: Solr did not start or was not reachable. Check the logs for errors.
> {noformat}
> As compared to how it worked before:
> {noformat}
> set SOLR_HOST=myhost.example.com
> set SOLR_JETTY_HOST=10.0.x.x
> solr-9.10.1-slim\bin\solr.cmd start -p 8981
> Waiting up to 180 seconds to see Solr running on port 8981
> Started Solr server on port 8981. Happy searching!
> {noformat}
> Then it correctly passed {{--solr-url http://myhost.example.com:8981}} to the 
> status tool.
> Fwiw, adding back the creation of a Solr URL based on {{SOLR_TOOL_HOST}} to 
> the script seems to fix the issue:
> {noformat}
> IF NOT "%SOLR_HOST_ADVERTISE%"=="" (
>   set SOLR_TOOL_HOST=%SOLR_HOST_ADVERTISE%
> ) ELSE (
>   set SOLR_TOOL_HOST=localhost
> )
> ... --solr-url !SOLR_URL_SCHEME!://%SOLR_TOOL_HOST%:%SOLR_PORT_LISTEN%
> {noformat}



--
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