cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject git commit: Avoids NPE on aborted stream sessions
Date Tue, 14 Feb 2012 13:14:26 GMT
Updated Branches:
  refs/heads/cassandra-1.1 82a75d4ae -> e0c655dc8


Avoids NPE on aborted stream sessions

patch by scode; reviewed by slebresne for CASSANDRA-3904


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

Branch: refs/heads/cassandra-1.1
Commit: e0c655dc8555bacd3c16a4a69be6776e3f7b1b1e
Parents: 82a75d4
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Tue Feb 14 14:12:45 2012 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Tue Feb 14 14:14:05 2012 +0100

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 .../apache/cassandra/streaming/FileStreamTask.java |    8 +++++++-
 .../cassandra/streaming/StreamOutSession.java      |    3 ++-
 3 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/e0c655dc/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index e5693ca..10ff2be 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -74,6 +74,7 @@
  * Make secondary indexes CF inherit compression and compaction from their
    parent CF (CASSANDRA-3877)
  * Finish cleanup up tombstone purge code (CASSANDRA-3872)
+ * Avoid NPE on aboarted stream-out sessions (CASSANDRA-3904)
 
 
 1.0.8

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e0c655dc/src/java/org/apache/cassandra/streaming/FileStreamTask.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/streaming/FileStreamTask.java b/src/java/org/apache/cassandra/streaming/FileStreamTask.java
index 8cd9a63..948bea7 100644
--- a/src/java/org/apache/cassandra/streaming/FileStreamTask.java
+++ b/src/java/org/apache/cassandra/streaming/FileStreamTask.java
@@ -94,7 +94,13 @@ public class FileStreamTask extends WrappedRunnable
             // successfully connected: stream.
             // (at this point, if we fail, it is the receiver's job to re-request)
             stream();
-            if (StreamOutSession.get(to, header.sessionId).getFiles().size() == 0)
+
+            StreamOutSession session = StreamOutSession.get(to, header.sessionId);
+            if (session == null)
+            {
+                logger.info("Found no stream out session at end of file stream task - this
is expected if the receiver went down");
+            }
+            else if (session.getFiles().size() == 0)
             {
                 // we are the last of our kind, receive the final confirmation before closing
                 receiveReply();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/e0c655dc/src/java/org/apache/cassandra/streaming/StreamOutSession.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/streaming/StreamOutSession.java b/src/java/org/apache/cassandra/streaming/StreamOutSession.java
index 3cbb294..ea5ccda 100644
--- a/src/java/org/apache/cassandra/streaming/StreamOutSession.java
+++ b/src/java/org/apache/cassandra/streaming/StreamOutSession.java
@@ -229,7 +229,8 @@ public class StreamOutSession implements IEndpointStateChangeSubscriber,
IFailur
         if (phi < 2 * DatabaseDescriptor.getPhiConvictThreshold())
             return;
 
-        logger.error("StreamOutSession {} failed because {} died or was restarted/removed",
endpoint);
+        logger.error("StreamOutSession {} failed because {} died or was restarted/removed
(streams may still be active "
+                + "in background, but further streams won't be started)", endpoint);
         close(false);
     }
 }


Mime
View raw message