This is an automated email from the ASF dual-hosted git repository.
epugh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new 84098343b6e SOLR-18318: Fix NPE in GetNodeSystemInfo when nodes param
is set (#4661)
84098343b6e is described below
commit 84098343b6eccd6347941393e239a656ffa68a03
Author: Yash Goswami <[email protected]>
AuthorDate: Wed Jul 29 21:19:50 2026 +0530
SOLR-18318: Fix NPE in GetNodeSystemInfo when nodes param is set (#4661)
---
changelog/unreleased/Yashgoswami-SOLR-18318.yml | 10 +++++++
.../solr/client/api/model/NodeSystemResponse.java | 6 ++--
.../admin/api/GetNodeSystemInfoSolrCloudTest.java | 32 ++++++++++++++++++++++
3 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/changelog/unreleased/Yashgoswami-SOLR-18318.yml
b/changelog/unreleased/Yashgoswami-SOLR-18318.yml
new file mode 100644
index 00000000000..030b8c9e6ba
--- /dev/null
+++ b/changelog/unreleased/Yashgoswami-SOLR-18318.yml
@@ -0,0 +1,10 @@
+# See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc
+
+title: >
+ Fix NullPointerException in GetNodeSystemInfo when the nodes parameter is
provided in SolrCloud mode
+type: fixed
+authors:
+ - name: Yash Goswami
+links:
+ - name: SOLR-18318
+ url: https://issues.apache.org/jira/browse/SOLR-18318
diff --git
a/solr/api/src/java/org/apache/solr/client/api/model/NodeSystemResponse.java
b/solr/api/src/java/org/apache/solr/client/api/model/NodeSystemResponse.java
index 1971e323dcd..4b6d1964afe 100644
--- a/solr/api/src/java/org/apache/solr/client/api/model/NodeSystemResponse.java
+++ b/solr/api/src/java/org/apache/solr/client/api/model/NodeSystemResponse.java
@@ -23,13 +23,13 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.LinkedHashMap;
/** Response from /node/system */
public class NodeSystemResponse extends SolrJerseyResponse {
- // TODO The typing here is kindof wonky - can I tighten 'Object' here to be
NodeSystemResponse or
- // will Jackson choke on that?
- public Map<String, Object> remoteNodeData;
+ // Object, not NodeSystemResponse, since @JsonAnySetter below also feeds
this map raw values.
+ public Map<String, Object> remoteNodeData = new LinkedHashMap<>();
@JsonAnyGetter
public Map<String, Object> remoteNodeData() {
diff --git
a/solr/core/src/test/org/apache/solr/handler/admin/api/GetNodeSystemInfoSolrCloudTest.java
b/solr/core/src/test/org/apache/solr/handler/admin/api/GetNodeSystemInfoSolrCloudTest.java
new file mode 100644
index 00000000000..578fd639a12
--- /dev/null
+++
b/solr/core/src/test/org/apache/solr/handler/admin/api/GetNodeSystemInfoSolrCloudTest.java
@@ -0,0 +1,32 @@
+package org.apache.solr.handler.admin.api;
+
+import org.apache.solr.client.solrj.request.CollectionAdminRequest;
+import org.apache.solr.client.solrj.request.SystemApi;
+import org.apache.solr.cloud.SolrCloudTestCase;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class GetNodeSystemInfoSolrCloudTest extends SolrCloudTestCase {
+
+ @BeforeClass
+ public static void setupCluster() throws Exception {
+ configureCluster(1).addConfig("conf",
configset("cloud-minimal")).configure();
+ CollectionAdminRequest.createCollection(DEFAULT_TEST_COLLECTION_NAME,
"conf", 1, 1)
+ .process(cluster.getSolrClient());
+ }
+
+ @Test
+ public void testGetNodeInfoWithNodesParam() throws Exception {
+ String nodeName =
+
cluster.getJettySolrRunners().get(0).getCoreContainer().getZkController().getNodeName();
+
+ final var req = new SystemApi.GetNodeSystemInfo();
+ req.setNodes(nodeName);
+
+ final var infoRsp = req.process(cluster.getSolrClient());
+
+ assertEquals(0, infoRsp.responseHeader.status);
+ assertNotNull(infoRsp.remoteNodeData);
+ assertTrue(infoRsp.remoteNodeData.containsKey(nodeName));
+ }
+}