cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [2/6] cassandra git commit: Fix NPE on stream read error
Date Wed, 02 Dec 2015 19:52:26 GMT
Fix NPE on stream read error

patch by yukim; reviewed by jmckenzie for CASSANDRA-10771


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

Branch: refs/heads/cassandra-3.1
Commit: a9a2d75b269cf5e53c40c69064d3478c1cd43643
Parents: b89037f
Author: Yuki Morishita <yukim@apache.org>
Authored: Wed Dec 2 13:50:18 2015 -0600
Committer: Yuki Morishita <yukim@apache.org>
Committed: Wed Dec 2 13:50:18 2015 -0600

----------------------------------------------------------------------
 CHANGES.txt                                                      | 1 +
 src/java/org/apache/cassandra/streaming/StreamReader.java        | 4 +---
 .../cassandra/streaming/compress/CompressedStreamReader.java     | 4 +---
 3 files changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a9a2d75b/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index d5a8dea..a82dcfc 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.1
+ * Fix NPE on stream read error (CASSANDRA-10771)
  * Normalize cqlsh DESC output (CASSANDRA-10431)
  * Rejects partition range deletions when columns are specified (CASSANDRA-10739)
  * Fix error when saving cached key for old format sstable (CASSANDRA-10778)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a9a2d75b/src/java/org/apache/cassandra/streaming/StreamReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/streaming/StreamReader.java b/src/java/org/apache/cassandra/streaming/StreamReader.java
index 4a38d5b..87dcda0 100644
--- a/src/java/org/apache/cassandra/streaming/StreamReader.java
+++ b/src/java/org/apache/cassandra/streaming/StreamReader.java
@@ -116,9 +116,7 @@ public class StreamReader
         {
             if (writer != null)
             {
-                Throwable e2 = writer.abort(null);
-                // add abort error to original and continue so we can drain unread stream
-                e.addSuppressed(e2);
+                writer.abort(e);
             }
             drain(dis, in.getBytesRead());
             if (e instanceof IOException)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a9a2d75b/src/java/org/apache/cassandra/streaming/compress/CompressedStreamReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/streaming/compress/CompressedStreamReader.java
b/src/java/org/apache/cassandra/streaming/compress/CompressedStreamReader.java
index 29882bc..4d10244 100644
--- a/src/java/org/apache/cassandra/streaming/compress/CompressedStreamReader.java
+++ b/src/java/org/apache/cassandra/streaming/compress/CompressedStreamReader.java
@@ -104,9 +104,7 @@ public class CompressedStreamReader extends StreamReader
         {
             if (writer != null)
             {
-                Throwable e2 = writer.abort(null);
-                // add abort error to original and continue so we can drain unread stream
-                e.addSuppressed(e2);
+                writer.abort(e);
             }
             drain(cis, in.getBytesRead());
             if (e instanceof IOException)


Mime
View raw message