Apache Lucene open-source search software
SOLR-10169: PeerSync will hit an NPE on no response errors when looking for fingerprint.
Erick Ericksona417a2cd6a61
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex dd4114a9268..e01036684fa 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -161,7 +161,9 @@ Bug Fixes(Amrit Sarkar, Varun Thacker)* SOLR-11840: Fix bin/solr help-text inconsistencies (Jason Gerlowski)-++* SOLR-10169: PeerSync will hit an NPE on no response errors when looking for fingerprint. (Erick Erickson)+Optimizations----------------------diff --git a/solr/core/src/java/org/apache/solr/update/PeerSync.java b/solr/core/src/java/org/apache/solr/update/PeerSync.javaindex 10b3ea11858..3511a6cb473 100644--- a/solr/core/src/java/org/apache/solr/update/PeerSync.java+++ b/solr/core/src/java/org/apache/solr/update/PeerSync.java@@ -388,9 +388,13 @@ public class PeerSync implements SolrMetricProducer {ShardResponse srsp = shardHandler.takeCompletedOrError();if (srsp == null) break;- Object replicaFingerprint = srsp.getSolrResponse().getResponse().get("fingerprint");+ Object replicaFingerprint = null;+ if (srsp.getSolrResponse() != null && srsp.getSolrResponse().getResponse() != null) {+ replicaFingerprint = srsp.getSolrResponse().getResponse().get("fingerprint");+ }+if (replicaFingerprint == null) {- log.warn("Replica did not return a fingerprint - possibly an older Solr version");+ log.warn("Replica did not return a fingerprint - possibly an older Solr version or exception");continue;}@@ -402,7 +406,7 @@ public class PeerSync implements SolrMetricProducer {return true;}} catch(IOException e) {- log.warn("Could not cofirm if we are already in sync. Continue with PeerSync");+ log.warn("Could not confirm if we are already in sync. Continue with PeerSync");}}