cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ble...@apache.org
Subject [02/10] cassandra git commit: Fix potential NPE when resume bootstrap fails
Date Fri, 14 Jul 2017 09:47:23 GMT
Fix potential NPE when resume bootstrap fails

patch by Tim Lamballais; reviewed by Benjamin Lerer for CASSANDRA-13272


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/5b982d79
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/5b982d79
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/5b982d79

Branch: refs/heads/cassandra-3.0
Commit: 5b982d790bffbf1beb92fd605f6f213914ba4b63
Parents: cb6fad3
Author: Tim Lamballais <timlamballais@gmail.com>
Authored: Fri Jul 14 11:28:12 2017 +0200
Committer: Benjamin Lerer <b.lerer@gmail.com>
Committed: Fri Jul 14 11:28:12 2017 +0200

----------------------------------------------------------------------
 CHANGES.txt                                             |  1 +
 .../org/apache/cassandra/service/StorageService.java    | 12 ++++++++++--
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5b982d79/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 6740c9e..122ba54 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.2.11
+ * Fix potential NPE when resume bootstrap fails (CASSANDRA-13272)
  * Fix toJSONString for the UDT, tuple and collection types (CASSANDRA-13592)
  * Fix nested Tuples/UDTs validation (CASSANDRA-13646)
  * Remove unused max_value_size_in_mb config setting from yaml (CASSANDRA-13625

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5b982d79/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index 9d2d7bb..1ecedac 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1254,8 +1254,16 @@ public class StorageService extends NotificationBroadcasterSupport
implements IE
                 @Override
                 public void onFailure(Throwable e)
                 {
-                    String message = "Error during bootstrap: " + e.getCause().getMessage();
-                    logger.error(message, e.getCause());
+                    String message = "Error during bootstrap: ";
+                    if (e instanceof ExecutionException && e.getCause() != null)
+                    {
+                        message += e.getCause().getMessage();
+                    }
+                    else
+                    {
+                        message += e.getMessage();
+                    }
+                    logger.error(message, e);
                     progressSupport.progress("bootstrap", new ProgressEvent(ProgressEventType.ERROR,
1, 1, message));
                     progressSupport.progress("bootstrap", new ProgressEvent(ProgressEventType.COMPLETE,
1, 1, "Resume bootstrap complete"));
                 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message