You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2021/05/24 15:52:40 UTC

[lucene-solr] branch branch_8x updated: LUCENE-9967: don't throw NullPointerException while handling a different root-cause exception in ReplicaNode.start

This is an automated email from the ASF dual-hosted git repository.

mikemccand pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new 19ce665  LUCENE-9967: don't throw NullPointerException while handling a different root-cause exception in ReplicaNode.start
19ce665 is described below

commit 19ce6659ab189434a89ab948f7c3f21a9fc7717c
Author: Mike McCandless <mi...@apache.org>
AuthorDate: Mon May 24 11:52:12 2021 -0400

    LUCENE-9967: don't throw NullPointerException while handling a different root-cause exception in ReplicaNode.start
---
 lucene/CHANGES.txt                                                     | 3 +++
 .../src/java/org/apache/lucene/replicator/nrt/ReplicaNode.java         | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index 1fc1253..7cb50ce 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -83,6 +83,9 @@ Bug Fixes
   the total count for a dimension. Prior to this fix, multi-value docs could contribute a > 1
   count to the dimension count. (Greg Miller)
 
+* LUCEDNE-9967: Do not throw NullPointerException while trying to handle another exception in
+  ReplicaNode.start (Steven Schlansker)
+
 Other
 ---------------------
 
diff --git a/lucene/replicator/src/java/org/apache/lucene/replicator/nrt/ReplicaNode.java b/lucene/replicator/src/java/org/apache/lucene/replicator/nrt/ReplicaNode.java
index 174a11f..7cfcda9 100644
--- a/lucene/replicator/src/java/org/apache/lucene/replicator/nrt/ReplicaNode.java
+++ b/lucene/replicator/src/java/org/apache/lucene/replicator/nrt/ReplicaNode.java
@@ -29,6 +29,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Objects;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
@@ -298,7 +299,7 @@ public abstract class ReplicaNode extends Node {
       message("top: done start");
       state = "idle";
     } catch (Throwable t) {
-      if (t.getMessage().startsWith("replica cannot start") == false) {
+      if (Objects.toString(t.getMessage()).startsWith("replica cannot start") == false) {
         message("exc on start:");
         t.printStackTrace(printStream);
       } else {