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 14:52:07 UTC
[lucene] branch main 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 main
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/main by this push:
new 654e978 LUCENE-9967: don't throw NullPointerException while handling a different root-cause exception in ReplicaNode.start
654e978 is described below
commit 654e978190719bd88f8a7d05a96a78e8365a6b81
Author: Mike McCandless <mi...@apache.org>
AuthorDate: Mon May 24 10:51:26 2021 -0400
LUCENE-9967: don't throw NullPointerException while handling a different root-cause exception in ReplicaNode.start
---
lucene/CHANGES.txt | 4 +++-
.../src/java/org/apache/lucene/replicator/nrt/ReplicaNode.java | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index d88fd79..79db029 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -229,7 +229,6 @@ Improvements
Bug fixes
-
* LUCENE-9686: Fix read past EOF handling in DirectIODirectory. (Zach Chen,
Julie Tibshirani)
@@ -395,6 +394,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 2e616a8..ee0becb 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;
@@ -332,7 +333,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 {