From 4ba9f68505677c4a49907b78e2e97627ea6d7338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 17 Nov 2026 01:33:16 +0100 Subject: [PATCH 1/5] Grant URLPermission by wildcard host so the policy parses under JDK-8305346 java.net.URLPermission normalises a numeric IPv4 authority through java.net.HostPortrange, which formats the address with a Formatter bound to Locale.US. The "%d" conversion needs DecimalFormatSymbols, so it has to load the CLDR locale provider, and that cannot be instantiated while the policy file is still being parsed. The policy parser swallows the resulting ServiceConfigurationError, prints a warning and silently drops the entry, so the five 127.0.0.1 grants were never in effect. The [::1] grants survive only because the IPv6 branch formats with "%02x", which needs no decimal symbols. On a full parallel CI run 49 forked test JVMs each printed ten lines of this warning, 490 lines in total. No setting of java.locale.providers avoids it and granting AllPermission does not help either; the JDK bug is closed as won't-fix because the security manager is removed in JDK 24. A wildcard host parses fine and widens nothing in practice: the SocketPermission grants a few lines above still confine every connect to localhost, 127.0.0.1 and [::1]. --- .../randomization/policies/solr-tests.policy | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gradle/testing/randomization/policies/solr-tests.policy b/gradle/testing/randomization/policies/solr-tests.policy index f93c8cd997c1..2efe4e5d524e 100644 --- a/gradle/testing/randomization/policies/solr-tests.policy +++ b/gradle/testing/randomization/policies/solr-tests.policy @@ -189,9 +189,12 @@ grant { permission java.net.NetPermission "requestPasswordAuthentication"; // for java.net.http.HttpClient. See HttpJdkSolrClientTest - permission "java.net.URLPermission" "http://127.0.0.1:*/solr/-", "HEAD,GET,PUT,POST:*"; - permission "java.net.URLPermission" "https://127.0.0.1:*/solr/-", "HEAD,GET,PUT,POST:*"; - permission "java.net.URLPermission" "socket://127.0.0.1:*", "CONNECT:*"; + // JDK-8305346: a URLPermission with a numeric IPv4 host cannot be parsed while the policy is + // bootstrapping, so such a grant is dropped with a warning; the SocketPermissions above are what + // actually confine these to loopback, so the host is a wildcard here. + permission "java.net.URLPermission" "http://*:*/solr/-", "HEAD,GET,PUT,POST:*"; + permission "java.net.URLPermission" "https://*:*/solr/-", "HEAD,GET,PUT,POST:*"; + permission "java.net.URLPermission" "socket://*:*", "CONNECT:*"; permission "java.net.URLPermission" "http://localhost:*/solr/-", "HEAD,GET,PUT,POST:*"; permission "java.net.URLPermission" "https://localhost:*/solr/-", "HEAD,GET,PUT,POST:*"; @@ -202,8 +205,8 @@ grant { permission "java.net.URLPermission" "socket://[::1]:*", "CONNECT:*"; // for java.net.http.HttpClient. See ConcurrentUpdateJdkSolrClientTest - permission "java.net.URLPermission" "http://127.0.0.1:*/noOneThere/-", "HEAD,GET,PUT,POST:*"; - permission "java.net.URLPermission" "https://127.0.0.1:*/noOneThere/-", "HEAD,GET,PUT,POST:*"; + permission "java.net.URLPermission" "http://*:*/noOneThere/-", "HEAD,GET,PUT,POST:*"; + permission "java.net.URLPermission" "https://*:*/noOneThere/-", "HEAD,GET,PUT,POST:*"; permission "java.net.URLPermission" "http://localhost:*/noOneThere/-", "HEAD,GET,PUT,POST:*"; permission "java.net.URLPermission" "https://localhost:*/noOneThere/-", "HEAD,GET,PUT,POST:*"; permission "java.net.URLPermission" "http://[::1]:*/noOneThere/-", "HEAD,GET,PUT,POST:*"; From f0bb8503f50137ed58f2eec8c70253c8b103f3c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 17 Nov 2026 01:34:38 +0100 Subject: [PATCH 2/5] Let the test policy register JDK events so JFR metrics work under the security manager OtelRuntimeJvmMetrics opens a JFR recording stream for the JVM metrics, and the JVM then wants to register its own JDK event classes. Without these grants the JFR subsystem logs [warning][jfr,system] Could not initialize JDK events. access denied ("java.lang.RuntimePermission" "accessClassInPackage.jdk.internal.event") and carries on with no JDK events, which silently disables the JFR-sourced jvm.system.cpu.utilization gauge that OtelRuntimeJvmMetrics deliberately prefers over JMX. The same three grants were added to solr/server/etc/security.policy already; this brings the test policy in line. --- gradle/testing/randomization/policies/solr-tests.policy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gradle/testing/randomization/policies/solr-tests.policy b/gradle/testing/randomization/policies/solr-tests.policy index 2efe4e5d524e..3d4597646d36 100644 --- a/gradle/testing/randomization/policies/solr-tests.policy +++ b/gradle/testing/randomization/policies/solr-tests.policy @@ -295,4 +295,8 @@ grant { grant { permission jdk.jfr.FlightRecorderPermission "accessFlightRecorder"; + // OtelRuntimeJvmMetrics opens a JFR recording stream for the JVM metrics + permission jdk.jfr.FlightRecorderPermission "registerEvent"; + permission java.lang.RuntimePermission "accessClassInPackage.jdk.jfr.internal.event"; + permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.event"; }; From 556b7adeccb583e199dab2615fe3d34a2c269141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 17 Nov 2026 01:49:10 +0100 Subject: [PATCH 3/5] Turn deprecation warnings on per module, starting with api and solrj With -Xlint:-deprecation javac still prints "uses or overrides a deprecated API" plus "Recompile with -Xlint:deprecation for details" as a mandatory note, and nothing suppresses it: not -nowarn, not -Xlint:none, not -Xmaxwarns 0. The only way to be rid of it is to turn the warnings on and have none left. So javac.gradle now keeps a list of projects that compile clean with -Xlint:deprecation, and :solr:api and :solr:solrj are the first two. Four @Schema(required = true) uses move to requiredMode, the hamcrest isIn matchers become in, and CloudSolrClient.getClusterState() calls go straight to the cluster state provider the deprecated method delegates to. The rest are suppressed with a reason, mostly in tests whose whole point is to cover the deprecated API. Generated request classes write to model fields that may be deprecated, so the setter in the Mustache template suppresses it too. Other modules keep the note until they are cleaned up the same way; :solr:core alone still has around 332 warnings. --- gradle/java/javac.gradle | 10 ++++- .../model/AddPackageVersionRequestBody.java | 6 ++- .../model/AddReplicaPropertyRequestBody.java | 4 +- .../api/model/RenameCoreRequestBody.java | 4 +- .../client/solrj/impl/HttpJdkSolrClient.java | 1 + .../solrj/request/CollectionAdminRequest.java | 1 + .../src/resources/java-template/api.mustache | 2 + .../solr/client/solrj/SolrExampleTests.java | 1 + .../solrj/embedded/TestSolrProperties.java | 1 + .../solrj/impl/CloudHttp2SolrClientTest.java | 37 +++++++++++++++---- .../solrj/impl/HttpJdkSolrClientTest.java | 1 + .../SendUpdatesToLeadersOverrideTest.java | 35 +++++++++--------- .../solrj/request/QueryRequestTest.java | 1 + .../solr/client/solrj/request/SchemaTest.java | 1 + .../client/solrj/request/SolrPingTest.java | 1 + .../client/solrj/request/SolrQueryTest.java | 1 + .../request/TestConfigSetAdminRequest.java | 1 + .../client/solrj/request/TestCoreAdmin.java | 1 + .../client/solrj/request/TestV2Request.java | 2 +- .../solrj/response/TermsResponseTest.java | 1 + .../PerReplicaStatesIntegrationTest.java | 1 + 21 files changed, 83 insertions(+), 30 deletions(-) diff --git a/gradle/java/javac.gradle b/gradle/java/javac.gradle index e4049b3e62dd..076dc9a4fb7e 100644 --- a/gradle/java/javac.gradle +++ b/gradle/java/javac.gradle @@ -17,6 +17,14 @@ // Configure Java project defaults. +// Projects that compile free of deprecation warnings and so can keep -Xlint:deprecation on. +// Everywhere else javac prints an unsuppressable "uses or overrides a deprecated API" note +// instead; move a project here once its warnings are gone. +def deprecationLintProjects = [ + ":solr:api", + ":solr:solrj", +] + allprojects { plugins.withType(JavaPlugin) { java { @@ -38,7 +46,7 @@ allprojects { tasks.withType(JavaCompile) { options.encoding = "UTF-8" options.compilerArgs += [ - "-Xlint:-deprecation", + deprecationLintProjects.contains(project.path) ? "-Xlint:deprecation" : "-Xlint:-deprecation", "-Xlint:-serial", "-Xlint:cast", "-Xlint:classfile", diff --git a/solr/api/src/java/org/apache/solr/client/api/model/AddPackageVersionRequestBody.java b/solr/api/src/java/org/apache/solr/client/api/model/AddPackageVersionRequestBody.java index 3b077c110d3b..38c452e1bb4a 100644 --- a/solr/api/src/java/org/apache/solr/client/api/model/AddPackageVersionRequestBody.java +++ b/solr/api/src/java/org/apache/solr/client/api/model/AddPackageVersionRequestBody.java @@ -24,13 +24,15 @@ public class AddPackageVersionRequestBody { @JsonProperty("version") - @Schema(description = "The version string for this package version.", required = true) + @Schema( + description = "The version string for this package version.", + requiredMode = Schema.RequiredMode.REQUIRED) public String version; @JsonProperty("files") @Schema( description = "File paths from the file store to include in this version.", - required = true) + requiredMode = Schema.RequiredMode.REQUIRED) public List files; @JsonProperty("manifest") diff --git a/solr/api/src/java/org/apache/solr/client/api/model/AddReplicaPropertyRequestBody.java b/solr/api/src/java/org/apache/solr/client/api/model/AddReplicaPropertyRequestBody.java index 603524e4ad1e..d4b929d64c21 100644 --- a/solr/api/src/java/org/apache/solr/client/api/model/AddReplicaPropertyRequestBody.java +++ b/solr/api/src/java/org/apache/solr/client/api/model/AddReplicaPropertyRequestBody.java @@ -27,7 +27,9 @@ public AddReplicaPropertyRequestBody(String value) { this.value = value; } - @Schema(description = "The value to assign to the property.", required = true) + @Schema( + description = "The value to assign to the property.", + requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty("value") public String value; diff --git a/solr/api/src/java/org/apache/solr/client/api/model/RenameCoreRequestBody.java b/solr/api/src/java/org/apache/solr/client/api/model/RenameCoreRequestBody.java index 55037117fe80..888fc12d2068 100644 --- a/solr/api/src/java/org/apache/solr/client/api/model/RenameCoreRequestBody.java +++ b/solr/api/src/java/org/apache/solr/client/api/model/RenameCoreRequestBody.java @@ -20,7 +20,9 @@ import io.swagger.v3.oas.annotations.media.Schema; public class RenameCoreRequestBody { - @Schema(description = "The new name for the Solr core.", required = true) + @Schema( + description = "The new name for the Solr core.", + requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty public String to; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpJdkSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpJdkSolrClient.java index 07f809e60024..06cf8bec3255 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpJdkSolrClient.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpJdkSolrClient.java @@ -473,6 +473,7 @@ private synchronized boolean maybeTryHeadRequestSync(URI uriNoQueryParams) { return headSucceeded; } + @SuppressWarnings("deprecation") // getContext() has no replacement yet; see SOLR-14720 private void decorateRequest(HttpRequest.Builder reqb, SolrRequest solrRequest) { reqb.timeout(Duration.of(requestTimeoutMillis, ChronoUnit.MILLIS)); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java index 79e6b8700428..44cd6a1488f5 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/CollectionAdminRequest.java @@ -261,6 +261,7 @@ public RequestStatusState processAndWait(String asyncId, SolrClient client, long } @Override + @SuppressWarnings("deprecation") // the parameter itself is on its way out; see SOLR-17712 public SolrParams getParams() { ModifiableSolrParams params = new ModifiableSolrParams(super.getParams()); if (asyncId != null) { diff --git a/solr/solrj/src/resources/java-template/api.mustache b/solr/solrj/src/resources/java-template/api.mustache index b8c0dce81687..296bfd2b3603 100644 --- a/solr/solrj/src/resources/java-template/api.mustache +++ b/solr/solrj/src/resources/java-template/api.mustache @@ -189,6 +189,8 @@ public class {{classname}} { * @param {{name}} {{description}} */ {{/description}} + // the model field this writes to may itself be deprecated + @SuppressWarnings("deprecation") public void {{setter}}({{{dataType}}} {{name}}) { this.requestBody.{{name}} = {{name}}; } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java index ab0860f0b5e3..a84449977d2e 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java @@ -1155,6 +1155,7 @@ public void testStatistics() throws Exception { } @Test + @SuppressWarnings("deprecation") // covers the deprecated ping() public void testPingHandler() throws Exception { SolrClient client = getSolrClient(); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java index 0c46c15fc50e..79bd7633698c 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/embedded/TestSolrProperties.java @@ -28,6 +28,7 @@ import org.junit.Test; /** Test properties in configuration files. */ +@SuppressWarnings("deprecation") // the embedded base class is deprecated, not this test public class TestSolrProperties extends AbstractEmbeddedSolrServerTestCase { @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java index fc9825b30ca4..1981c46332b3 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientTest.java @@ -389,7 +389,8 @@ public void testShardReplicationFactors() throws Exception { CollectionAdminRequest.createCollection(collection, "conf", 2, 1).process(client); cluster.waitForActiveCollection(collection, 2, 2); - DocCollection col = client.getClusterState().getCollection(collection); + DocCollection col = + client.getClusterStateProvider().getClusterState().getCollection(collection); String shard1Url = col.getSlice("shard1").getLeader().getCoreUrl(); String shard2Url = col.getSlice("shard2").getLeader().getCoreUrl(); NamedList> routeResponses = new NamedList<>(); @@ -482,7 +483,7 @@ public void testRouting() throws Exception { // Test that queries with _route_ params are routed by the client // Track request counts on each node before query calls - ClusterState clusterState = cluster.getSolrClient().getClusterState(); + ClusterState clusterState = cluster.getSolrClient().getClusterStateProvider().getClusterState(); DocCollection col = clusterState.getCollection("routing_collection"); Map requestCountsMap = new HashMap<>(); for (Slice slice : col.getSlices()) { @@ -853,7 +854,12 @@ public void stateVersionParamTest() throws Exception { .process(cluster.getSolrClient()); cluster.waitForActiveCollection(COLLECTION, 2, 2); - DocCollection coll = cluster.getSolrClient().getClusterState().getCollection(COLLECTION); + DocCollection coll = + cluster + .getSolrClient() + .getClusterStateProvider() + .getClusterState() + .getCollection(COLLECTION); Replica r = coll.getSlices().iterator().next().getReplicas().iterator().next(); SolrQuery q = new SolrQuery().setQuery("*:*"); @@ -896,7 +902,8 @@ public void stateVersionParamTest() throws Exception { } } String theNode = null; - Set liveNodes = cluster.getSolrClient().getClusterState().getLiveNodes(); + Set liveNodes = + cluster.getSolrClient().getClusterStateProvider().getClusterState().getLiveNodes(); for (String s : liveNodes) { String n = cluster.getZkStateReader().getBaseUrlForNodeName(s); if (!allNodesOfColl.contains(n)) { @@ -1069,7 +1076,12 @@ public void testRetryUpdatesWhenClusterStateIsStale() throws Exception { // determine the coreNodeName of only current replica Collection slices = - cluster.getSolrClient().getClusterState().getCollection(COL).getSlices(); + cluster + .getSolrClient() + .getClusterStateProvider() + .getClusterState() + .getCollection(COL) + .getSlices(); assertEquals(1, slices.size()); // sanity check Slice slice = slices.iterator().next(); assertEquals(1, slice.getReplicas().size()); // sanity check @@ -1125,7 +1137,12 @@ public void testRetryUpdatesWhenClusterStateIsStale() throws Exception { /** Asserts that each doc is on the leader of the shard it routes to, querying that core alone. */ private static void assertDocsOnShardLeaders(String collection, String... ids) throws Exception { - DocCollection col = cluster.getSolrClient().getClusterState().getCollection(collection); + DocCollection col = + cluster + .getSolrClient() + .getClusterStateProvider() + .getClusterState() + .getCollection(collection); for (String id : ids) { String coreUrl = col.getRouter().getTargetSlice(id, null, null, null, col).getLeader().getCoreUrl(); @@ -1144,7 +1161,11 @@ private static void checkSingleServer(NamedList response) { NamedList rfByRoute = (NamedList) header.get(CloudSolrClient.REPFACT_BY_ROUTE); assertNotNull("no per-route rf in " + header, rfByRoute); DocCollection col = - cluster.getSolrClient().getClusterState().getCollection("routing_collection"); + cluster + .getSolrClient() + .getClusterStateProvider() + .getClusterState() + .getCollection("routing_collection"); Set leaderUrls = new HashSet<>(); for (Slice slice : col.getSlices()) { leaderUrls.add(slice.getLeader().getCoreUrl()); @@ -1263,6 +1284,7 @@ private void queryWithPreferReplicaTypes( } @Test + @SuppressWarnings("deprecation") // covers the deprecated ping() public void testPing() throws Exception { final String testCollection = "ping_test"; CollectionAdminRequest.createCollection(testCollection, "conf", 2, 1) @@ -1275,6 +1297,7 @@ public void testPing() throws Exception { assertEquals("This should be OK", 0, response.getStatus()); } + @SuppressWarnings("deprecation") // covers the deprecated ping() public void testPerReplicaStateCollection() throws Exception { String collection = getSaferTestName(); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/HttpJdkSolrClientTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/HttpJdkSolrClientTest.java index 9f9233f375e8..abfb6b2d123f 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/HttpJdkSolrClientTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/HttpJdkSolrClientTest.java @@ -615,6 +615,7 @@ public void testCookieHandlerSettingHonored() throws Exception { } @Test + @SuppressWarnings("deprecation") // covers the deprecated ping() public void testPing() throws Exception { try (HttpJdkSolrClient client = builder(solrTestRule.getBaseUrl()).build()) { SolrPingResponse spr = client.ping("collection1"); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/SendUpdatesToLeadersOverrideTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/SendUpdatesToLeadersOverrideTest.java index 08f3367edcc4..ba2117fdb3a5 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/SendUpdatesToLeadersOverrideTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/SendUpdatesToLeadersOverrideTest.java @@ -19,7 +19,7 @@ import static org.hamcrest.Matchers.everyItem; import static org.hamcrest.Matchers.hasSize; -import static org.hamcrest.Matchers.isIn; +import static org.hamcrest.Matchers.in; import static org.hamcrest.Matchers.not; import java.lang.invoke.MethodHandles; @@ -94,6 +94,7 @@ public static void setupCluster() throws Exception { final List allReplicas = cluster .getSolrClient() + .getClusterStateProvider() .getClusterState() .getCollection(COLLECTION_NAME) .replicaStream() @@ -194,7 +195,7 @@ private static RecordingResults assertUpdateWithRecording( assertThat( "post-distrib should never be PULL replica", results.postDistribCores.keySet(), - everyItem(not(isIn(PULL_REPLICA_CORE_NAMES)))); + everyItem(not(in(PULL_REPLICA_CORE_NAMES)))); return results; } @@ -252,7 +253,7 @@ private void checkUpdatesDefaultToLeaders(final CloudSolrClient client) throws E assertThat( "add pre-distrib must be leader", add.preDistribCores.keySet(), - everyItem(isIn(LEADER_CORE_NAMES))); + everyItem(in(LEADER_CORE_NAMES))); assertEquals( "add pre and post should match", add.preDistribCores.keySet(), @@ -286,7 +287,7 @@ private void checkUpdatesDefaultToLeaders(final CloudSolrClient client) throws E assertThat( "dbq pre-distrib must be leader", record.preDistribCores.keySet(), - everyItem(isIn(LEADER_CORE_NAMES))); + everyItem(in(LEADER_CORE_NAMES))); assertThat("dbq pre-distrib size", record.preDistribRequests.keySet(), hasSize(1)); assertThat("dbq pre-distrib size", record.preDistribCommands, hasSize(1)); @@ -315,7 +316,7 @@ private void checkUpdatesDefaultToLeaders(final CloudSolrClient client) throws E assertThat( "multi pre-distrib must be leaders", record.preDistribCores.keySet(), - everyItem(isIn(LEADER_CORE_NAMES))); + everyItem(in(LEADER_CORE_NAMES))); assertThat( "multi pre-distrib req != pre-distrib num cores", record.preDistribRequests.keySet(), @@ -356,7 +357,7 @@ private void checkUpdatesWithShardsPrefPull(final CloudSolrClient client) throws assertThat( "add pre-distrib must be PULL", add.preDistribCores.keySet(), - everyItem(isIn(PULL_REPLICA_CORE_NAMES))); + everyItem(in(PULL_REPLICA_CORE_NAMES))); assertThat("add pre-distrib size", add.preDistribRequests.keySet(), hasSize(1)); assertThat("add pre-distrib size", add.preDistribCommands, hasSize(1)); @@ -365,7 +366,7 @@ private void checkUpdatesWithShardsPrefPull(final CloudSolrClient client) throws assertThat( "add post-distrib must be leader", add.postDistribCores.keySet(), - everyItem(isIn(LEADER_CORE_NAMES))); + everyItem(in(LEADER_CORE_NAMES))); assertThat("add post-distrib size", add.postDistribRequests.keySet(), hasSize(1)); assertThat("add post-distrib size", add.postDistribCommands, hasSize(1)); @@ -378,7 +379,7 @@ private void checkUpdatesWithShardsPrefPull(final CloudSolrClient client) throws assertThat( "del pre-distrib must be PULL", del.preDistribCores.keySet(), - everyItem(isIn(PULL_REPLICA_CORE_NAMES))); + everyItem(in(PULL_REPLICA_CORE_NAMES))); assertThat("del pre-distrib size", del.preDistribRequests.keySet(), hasSize(1)); assertThat("del pre-distrib size", del.preDistribCommands, hasSize(1)); @@ -398,7 +399,7 @@ private void checkUpdatesWithShardsPrefPull(final CloudSolrClient client) throws assertThat( "dbq pre-distrib must be PULL", record.preDistribCores.keySet(), - everyItem(isIn(PULL_REPLICA_CORE_NAMES))); + everyItem(in(PULL_REPLICA_CORE_NAMES))); assertThat("dbq pre-distrib size", record.preDistribRequests.keySet(), hasSize(1)); assertThat("dbq pre-distrib size", record.preDistribCommands, hasSize(1)); @@ -425,7 +426,7 @@ private void checkUpdatesWithShardsPrefPull(final CloudSolrClient client) throws assertThat( "multi pre-distrib must be PULL", record.preDistribCores.keySet(), - everyItem(isIn(PULL_REPLICA_CORE_NAMES))); + everyItem(in(PULL_REPLICA_CORE_NAMES))); assertThat("multi pre-distrib req size", record.preDistribRequests.keySet(), hasSize(1)); assertThat("multi pre-distrib command size", record.preDistribCommands, hasSize(100 + 10)); @@ -440,7 +441,7 @@ private void checkUpdatesWithShardsPrefPull(final CloudSolrClient client) throws assertThat( "multi post-distrib cores", record.postDistribCores.keySet(), - everyItem(isIn(LEADER_CORE_NAMES))); + everyItem(in(LEADER_CORE_NAMES))); assertThat("multi post-distrib command size", record.postDistribCommands, hasSize(100 + 10)); } } @@ -462,7 +463,7 @@ private void checkUpdatesWithSendToLeadersFalse(final CloudSolrClient client) th assertThat( "add pre-distrib must be PULL", add.preDistribCores.keySet(), - everyItem(isIn(PULL_REPLICA_CORE_NAMES))); + everyItem(in(PULL_REPLICA_CORE_NAMES))); assertThat("add pre-distrib size", add.preDistribRequests.keySet(), hasSize(1)); assertThat("add pre-distrib size", add.preDistribCommands, hasSize(1)); @@ -471,7 +472,7 @@ private void checkUpdatesWithSendToLeadersFalse(final CloudSolrClient client) th assertThat( "add post-distrib must be leader", add.postDistribCores.keySet(), - everyItem(isIn(LEADER_CORE_NAMES))); + everyItem(in(LEADER_CORE_NAMES))); assertThat("add post-distrib size", add.postDistribRequests.keySet(), hasSize(1)); assertThat("add post-distrib size", add.postDistribCommands, hasSize(1)); @@ -485,7 +486,7 @@ private void checkUpdatesWithSendToLeadersFalse(final CloudSolrClient client) th assertThat( "del pre-distrib must be PULL", del.preDistribCores.keySet(), - everyItem(isIn(PULL_REPLICA_CORE_NAMES))); + everyItem(in(PULL_REPLICA_CORE_NAMES))); assertThat("del pre-distrib size", del.preDistribRequests.keySet(), hasSize(1)); assertThat("del pre-distrib size", del.preDistribCommands, hasSize(1)); @@ -506,7 +507,7 @@ private void checkUpdatesWithSendToLeadersFalse(final CloudSolrClient client) th assertThat( "dbq pre-distrib must be PULL", record.preDistribCores.keySet(), - everyItem(isIn(PULL_REPLICA_CORE_NAMES))); + everyItem(in(PULL_REPLICA_CORE_NAMES))); assertThat("dbq pre-distrib size", record.preDistribRequests.keySet(), hasSize(1)); assertThat("dbq pre-distrib size", record.preDistribCommands, hasSize(1)); @@ -534,7 +535,7 @@ private void checkUpdatesWithSendToLeadersFalse(final CloudSolrClient client) th assertThat( "multi pre-distrib must be PULL", record.preDistribCores.keySet(), - everyItem(isIn(PULL_REPLICA_CORE_NAMES))); + everyItem(in(PULL_REPLICA_CORE_NAMES))); assertThat("multi pre-distrib req size", record.preDistribRequests.keySet(), hasSize(1)); assertThat("multi pre-distrib command size", record.preDistribCommands, hasSize(100 + 10)); @@ -549,7 +550,7 @@ private void checkUpdatesWithSendToLeadersFalse(final CloudSolrClient client) th assertThat( "multi post-distrib cores", record.postDistribCores.keySet(), - everyItem(isIn(LEADER_CORE_NAMES))); + everyItem(in(LEADER_CORE_NAMES))); assertThat("multi post-distrib command size", record.postDistribCommands, hasSize(100 + 10)); } } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/request/QueryRequestTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/request/QueryRequestTest.java index dfc314c2e8c8..a40b2d59ed1a 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/request/QueryRequestTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/request/QueryRequestTest.java @@ -20,6 +20,7 @@ import org.apache.solr.client.solrj.SolrRequest; import org.junit.Test; +@SuppressWarnings("deprecation") // covers the deprecated SolrQuery.setRequestHandler public class QueryRequestTest extends SolrTestCase { @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/request/SchemaTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/request/SchemaTest.java index cf50479bd433..c18f9f48158e 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/request/SchemaTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/request/SchemaTest.java @@ -104,6 +104,7 @@ public void init() throws Exception { } @After + @SuppressWarnings("deprecation") // no replacement for SolrJettyTestRule.reset() yet public void cleanup() throws Exception { solrTestRule.reset(); } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrPingTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrPingTest.java index 721a94925390..a7757a3a2be5 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrPingTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrPingTest.java @@ -29,6 +29,7 @@ import org.junit.Test; /** Test SolrPing in Solrj */ +@SuppressWarnings("deprecation") // this suite exists to cover the deprecated SolrPing public class SolrPingTest extends SolrTestCase { @ClassRule diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrQueryTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrQueryTest.java index 3621b697d7d2..1c86d6cc9e38 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrQueryTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/request/SolrQueryTest.java @@ -308,6 +308,7 @@ public void testFacetDateRange() { assertEquals("+1MONTH", q.get("f.field." + FacetParams.FACET_RANGE_GAP)); } + @SuppressWarnings("deprecation") // covers the deprecated requestHandler accessors too public void testSettersGetters() { SolrQuery q = new SolrQuery("foo"); assertEquals(10, q.setFacetLimit(10).getFacetLimit()); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestConfigSetAdminRequest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestConfigSetAdminRequest.java index 51c5a7bc5eec..bfbbfa0acb9c 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestConfigSetAdminRequest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestConfigSetAdminRequest.java @@ -92,6 +92,7 @@ private void verifyException(ConfigSetAdminRequest request, String errorCo private static class MyConfigSetAdminRequest extends ConfigSetAdminRequest { + @SuppressWarnings("deprecation") // the no-arg super constructor is deprecated public MyConfigSetAdminRequest() {} @Override diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java index 45198ba422c3..83eb5149ab73 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java @@ -41,6 +41,7 @@ import org.apache.solr.core.SolrCore; import org.junit.Test; +@SuppressWarnings("deprecation") // the embedded base class is deprecated, not this test public class TestCoreAdmin extends AbstractEmbeddedSolrServerTestCase { @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestV2Request.java b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestV2Request.java index aebadc76a426..c26e551a5bff 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestV2Request.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestV2Request.java @@ -138,7 +138,7 @@ public void testV2Forwarding() throws Exception { + "}") .build()); - ClusterState cs = cluster.getSolrClient().getClusterState(); + ClusterState cs = cluster.getSolrClient().getClusterStateProvider().getClusterState(); System.out.println("livenodes: " + cs.getLiveNodes()); String[] node = new String[1]; diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/response/TermsResponseTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/response/TermsResponseTest.java index a299ecb4e184..decea3e166f6 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/response/TermsResponseTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/response/TermsResponseTest.java @@ -50,6 +50,7 @@ public void setUp() throws Exception { } @Test + @SuppressWarnings("deprecation") // SolrQuery.setRequestHandler is deprecated public void testTermsResponse() throws Exception { SolrInputDocument doc = new SolrInputDocument(); doc.setField("id", 1); diff --git a/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java b/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java index 009857689d11..f3ccd7f2b1ee 100644 --- a/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java +++ b/solr/solrj/src/test/org/apache/solr/common/cloud/PerReplicaStatesIntegrationTest.java @@ -56,6 +56,7 @@ public class PerReplicaStatesIntegrationTest extends SolrCloudTestCase { private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + @SuppressWarnings("deprecation") // covers the deprecated ping() public void testPerReplicaStateCollection() throws Exception { String testCollection = "perReplicaState_test"; From f368558c38ff1feab6613edfd071b88c13d7d613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 17 Nov 2026 01:49:54 +0100 Subject: [PATCH 4/5] Cache the Gradle distribution in CI setup-gradle's gradle-home-cache-includes defaults to caches and notifications only, so the wrapper's distribution directory is never saved and every job downloads the Gradle zip again, printing the download and the welcome banner. --- .github/actions/prepare-for-build/action.yml | 5 +++++ .github/workflows/docker-nightly.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/.github/actions/prepare-for-build/action.yml b/.github/actions/prepare-for-build/action.yml index fa30567b88f0..277233d798ab 100644 --- a/.github/actions/prepare-for-build/action.yml +++ b/.github/actions/prepare-for-build/action.yml @@ -38,3 +38,8 @@ runs: # increase expiry time for the temp. develocity token. # https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#increasing-the-expiry-time-for-develocity-access-tokens develocity-token-expiry: 8 + # the default omits "wrapper", so the distribution zip is downloaded on every run + gradle-home-cache-includes: | + caches + notifications + wrapper diff --git a/.github/workflows/docker-nightly.yml b/.github/workflows/docker-nightly.yml index af65fa3c8f44..e88df30a1b0e 100644 --- a/.github/workflows/docker-nightly.yml +++ b/.github/workflows/docker-nightly.yml @@ -97,6 +97,11 @@ jobs: uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0 with: develocity-token-expiry: 8 + # the default omits "wrapper", so the distribution zip is downloaded on every run + gradle-home-cache-includes: | + caches + notifications + wrapper - name: Create custom gradle.properties run: | From 2c71a6fdac31c75302397f307016eb79cd17ac54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B8ydahl?= Date: Tue, 17 Nov 2026 01:51:58 +0100 Subject: [PATCH 5/5] Move the actions off Node 20 actions/cache v4 and actions/setup-java v4 in the shared composite action were the last two still targeting Node 20, so every job was warned that the runner forces them onto a newer Node. Both majors are already in use elsewhere in the repo; this brings the composite action in line. --- .github/actions/prepare-for-build/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/prepare-for-build/action.yml b/.github/actions/prepare-for-build/action.yml index 277233d798ab..728f91f976f6 100644 --- a/.github/actions/prepare-for-build/action.yml +++ b/.github/actions/prepare-for-build/action.yml @@ -19,14 +19,14 @@ runs: using: "composite" steps: - name: Set up Java (${{ inputs.java-distribution }}, ${{ inputs.java-version }})" - uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1 + uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1 with: distribution: ${{ inputs.java-distribution }} java-version: ${{ inputs.java-version }} java-package: jdk - name: Cache gradle-wrapper.jar - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: gradle/wrapper/gradle-wrapper.jar key: gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.jar.sha256') }}