SOLR-18318: Fix NPE in GetNodeSystemInfo when nodes param is set - #4661
SOLR-18318: Fix NPE in GetNodeSystemInfo when nodes param is set#4661Yashgoswami-ds wants to merge 3 commits into
Conversation
|
triggered CI. any chance you can look at the comment as well?? Be nice to know. |
|
Thanks for the suggestion. I’ll take a look at the |
|
looks like some precommit faiolures... I believe since this is a bugfix we need a changelog too. |
Thanks for pointing this out. I looked into the usage of remoteNodeData. The proxied response that we add in GetNodeSystemInfo is indeed a NodeSystemResponse, so I checked whether we could tighten the type to Map<String, NodeSystemResponse>. However, remoteNodeData is also populated through @JsonAnySetter, where Jackson provides dynamic fields with Object values. Changing the type would require changing the @JsonAnySetter handling as well, and it could affect the current JSON serialization/deserialization behavior of this response model. Since this PR is focused on fixing the NPE caused by remoteNodeData being uninitialized, I have kept the existing Object type and only initialized the map with a LinkedHashMap so proxied node responses can be safely stored. Thanks again for the suggestion. |
|
please review |
Description
Fixes an issue where the v2
/api/node/systemendpoint throws aNullPointerExceptionwhen thenodesparameter is provided in SolrCloud mode.The issue occurs when
GetNodeSystemInfoproxies requests to other nodes and tries to store the proxied responses inNodeSystemResponse.remoteNodeData. SinceremoteNodeDatawas not initialized, adding node responses caused an NPE and returned an HTTP 500 error instead of the expected aggregated node information.Solution
Initialized
NodeSystemResponse.remoteNodeDatawith aLinkedHashMapso that proxied node responses can be safely stored.Added a new SolrCloud test
GetNodeSystemInfoSolrCloudTestthat covers the failing scenario by requesting node system information with thenodesparameter and verifies that the response contains the expected node data.Tests
Ran: