cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bened...@apache.org
Subject [2/9] cassandra git commit: Fix StreamTransferTask abort/complete bad refcounting
Date Thu, 19 Feb 2015 11:55:00 GMT
Fix StreamTransferTask abort/complete bad refcounting

patch by benedict; reviewed by sankalp CASSANDRA-8815


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

Branch: refs/heads/cassandra-2.1
Commit: a762e5add2853b168e13fda7527837af045be81d
Parents: 58e6a1d
Author: Benedict Elliott Smith <benedict@apache.org>
Authored: Thu Feb 19 11:48:53 2015 +0000
Committer: Benedict Elliott Smith <benedict@apache.org>
Committed: Thu Feb 19 11:48:53 2015 +0000

----------------------------------------------------------------------
 CHANGES.txt                                      |  1 +
 .../cassandra/streaming/StreamTransferTask.java  | 19 ++++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a762e5ad/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 48751d9..076bb65 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.13:
+ * Fix StreamTransferTask abort/complete bad refcounting (CASSANDRA-8815)
  * Fix AssertionError when querying a DESC clustering ordered
    table with ASC ordering and paging (CASSANDRA-8767)
  * AssertionError: "Memory was freed" when running cleanup (CASSANDRA-8716)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a762e5ad/src/java/org/apache/cassandra/streaming/StreamTransferTask.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/streaming/StreamTransferTask.java b/src/java/org/apache/cassandra/streaming/StreamTransferTask.java
index 5b75555..8d699e1 100644
--- a/src/java/org/apache/cassandra/streaming/StreamTransferTask.java
+++ b/src/java/org/apache/cassandra/streaming/StreamTransferTask.java
@@ -22,6 +22,9 @@ import java.util.concurrent.*;
 import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.atomic.AtomicInteger;
 
+import com.google.common.base.Throwables;
+import com.google.common.collect.Iterables;
+
 import org.apache.cassandra.concurrent.NamedThreadFactory;
 import org.apache.cassandra.io.sstable.SSTableReader;
 import org.apache.cassandra.streaming.messages.OutgoingFileMessage;
@@ -91,8 +94,22 @@ public class StreamTransferTask extends StreamTask
             future.cancel(false);
         timeoutTasks.clear();
 
+        Throwable fail = null;
         for (OutgoingFileMessage file : files.values())
-            file.sstable.releaseReference();
+        {
+            try
+            {
+                file.sstable.releaseReference();
+            }
+            catch (Throwable t)
+            {
+                if (fail == null) fail = t;
+                else fail.addSuppressed(t);
+            }
+        }
+        files.clear();
+        if (fail != null)
+            Throwables.propagate(fail);
     }
 
     public synchronized int getTotalNumberOfFiles()


Mime
View raw message