epugh commented on code in PR #5399:
URL: https://github.com/apache/solr/pull/5399#discussion_r4720326748
##########
solr/core/src/java/org/apache/solr/cli/RunExampleTool.java:
##########
@@ -1619,16 +1624,19 @@ Map<String, Object> startSolr(
startCmd.addArguments(command.subList(1,
command.size()).toArray(String[]::new), false);
if (isWindows) {
- // On Windows, the execution doesn't return, so we have to execute async
- // and when calling the script, it seems to be inheriting the
environment that launched this
- // app, so we have to prune out env vars that may cause issues
+ // On Windows, the execution doesn't return, so we have to execute
async. This process runs
+ // inside bin\solr.cmd, whose SOLR_* variables are its own working
state, so the node gets
+ // the caller's SOLR_* settings instead, which solr.cmd saved as
CALLER_SOLR_* on entry.
Map<String, String> startEnv = new HashMap<>();
Map<String, String> procEnv = EnvironmentUtils.getProcEnvironment();
if (procEnv != null) {
for (Map.Entry<String, String> entry : procEnv.entrySet()) {
String envVar = entry.getKey();
String envVarVal = entry.getValue();
- if (envVarVal != null && !"EXAMPLE".equals(envVar) &&
!envVar.startsWith("SOLR_")) {
+ if (envVarVal == null || "EXAMPLE".equals(envVar)) continue;
Review Comment:
someday i bet there is some nice refacotring of this awkawrd class!
##########
changelog/unreleased/SOLR-18650-cmd-example-env.yml:
##########
@@ -0,0 +1,12 @@
+title: >
+ On Windows, nodes started by a bin/solr.cmd -e example now honour the
caller's SOLR_* settings,
Review Comment:
i doubly like the british spelling! ;-)
--
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]