janhoy commented on code in PR #5346:
URL: https://github.com/apache/solr/pull/5346#discussion_r4782423280


##########
solr/bin/solr.cmd:
##########
@@ -1292,6 +1289,32 @@ set eout=%eout:"=%
 echo !eout!
 GOTO :eof
 
+:resolve_stop_port
+  REM Each node knows its own stop port, so read it back from the running 
process.
+  REM The tool's output is captured through a temp file and not with a 'for 
/f' over its command
+  REM line: the quotes around -classpath are lost when the command is wrapped 
in backquotes, and
+  REM the class is then not found, which would leave every stop falling back 
to the derived port.
+  set RESOLVED_STOP_PORT=
+  set "STOP_PORT_ERR=nul"
+  IF "%verbose%"=="1" set "STOP_PORT_ERR=con"
+  set "STOP_PORT_OUT=%TEMP%\solr-stopport-%RANDOM%.txt"
+  "%JAVA%" %SOLR_TOOL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" ^
+    
-Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml"
 ^
+    -classpath 
"%SOLR_TIP%\lib\*;%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*"
 ^

Review Comment:
   🤖 Leaving as is. All tool invocations in both scripts use DEFAULT_SERVER_DIR 
for the classpath; changing that is a separate issue.



##########
solr/bin/solr:
##########
@@ -520,11 +521,14 @@ function stop_solr() {
 
   DIR="$1"
   SOLR_PORT_LISTEN="$2"
-  THIS_STOP_PORT="${STOP_PORT:-$((SOLR_PORT_LISTEN - 1000))}"
   STOP_KEY="$3"
   SOLR_PID="$4"
 
   if [ -n "$SOLR_PID"  ]; then
+    # Each node knows its own stop port, so read it back from the running 
process
+    THIS_STOP_PORT="$(run_tool status -p "$SOLR_PORT_LISTEN" --stop-port 
2>/dev/null | tail -1 | tr -cd '0-9')"

Review Comment:
   🤖 Done: exit status is checked and only an all-digit last line is accepted. 
0 and -1 are reported as unknown by the helper.



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