This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a commit to branch branch_10x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_10x by this push:
new 49db2fcafd5 HttpShardHandlerFactory urlScheme -- use sys prop for
default (#4008)
49db2fcafd5 is described below
commit 49db2fcafd5efb048c7a50e1b08af39540b50ebd
Author: David Smiley <[email protected]>
AuthorDate: Sun Jan 4 11:44:29 2026 -0500
HttpShardHandlerFactory urlScheme -- use sys prop for default (#4008)
HttpShardHandlerFactory reads the urlScheme from configuration, defaulting
to "http" if there is none. Most/all solr.xml's we have, especially for tests,
have this explicitly configured with urlScheme sys prop resolution. I think the
factory should read that sys prop as a default, at least as a small
improvement. This way, test JettySolrRunner stuff can start Solr in SSL mode
without needing a solr.xml.
Fixes DistributedDebugComponentTest and possibly more.
SolrTestCaseJ4: don't use constants from ZkTestReader inappropriately.
The affected lines are likely to be superseded by SOLR-18055
---
.../org/apache/solr/handler/component/HttpShardHandlerFactory.java | 3 ++-
solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java | 6 ++----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git
a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
index 862283da609..737fd5385de 100644
---
a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
+++
b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
@@ -224,7 +224,8 @@ public class HttpShardHandlerFactory extends
ShardHandlerFactory
public void init(PluginInfo info) {
StringBuilder sb = new StringBuilder();
NamedList<?> args = info.initArgs;
- this.scheme = getParameter(args, INIT_URL_SCHEME, null, sb);
+ // note: the sys prop is only used in testing
+ this.scheme = getParameter(args, INIT_URL_SCHEME,
System.getProperty(INIT_URL_SCHEME), sb);
if (this.scheme != null && this.scheme.endsWith("://")) {
this.scheme = this.scheme.replace("://", "");
}
diff --git a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
index b63352c0bda..f1c62f17ee8 100644
--- a/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
+++ b/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
@@ -17,8 +17,6 @@
package org.apache.solr;
import static java.util.Objects.requireNonNull;
-import static org.apache.solr.common.cloud.ZkStateReader.HTTPS;
-import static org.apache.solr.common.cloud.ZkStateReader.URL_SCHEME;
import static
org.apache.solr.update.processor.DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM;
import static org.hamcrest.core.StringContains.containsString;
@@ -291,7 +289,7 @@ public abstract class SolrTestCaseJ4 extends SolrTestCase {
HttpJettySolrClient.setDefaultSSLConfig(sslConfig.buildClientSSLConfig());
if (isSSLMode()) {
// SolrCloud tests should usually clear this
- System.setProperty(URL_SCHEME, HTTPS);
+ System.setProperty("urlScheme", "https");
}
ExecutorUtil.resetThreadLocalProviders();
@@ -325,7 +323,7 @@ public abstract class SolrTestCaseJ4 extends SolrTestCase {
System.clearProperty("tests.shardhandler.randomSeed");
System.clearProperty("solr.index.updatelog.enabled");
System.clearProperty("useCompoundFile");
- System.clearProperty(URL_SCHEME);
+ System.clearProperty("urlScheme");
System.clearProperty("solr.cloud.wait-for-updates-with-stale-state-pause");
System.clearProperty("solr.zkclienttmeout");
HttpClientUtil.resetHttpClientBuilder();