You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by mi...@apache.org on 2014/06/19 05:57:40 UTC

[04/10] git commit: Move latch.countDown() into "finally" block

Move latch.countDown() into "finally" block

patch by Mikhail Stepura; reviewed by Tyler Hobbs for CASSANDRA-7275


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

Branch: refs/heads/trunk
Commit: 6131273ac6c567579eef9da1237b39ff214ccf52
Parents: ea83797
Author: Mikhail Stepura <mi...@apache.org>
Authored: Wed Jun 11 15:19:22 2014 -0700
Committer: Mikhail Stepura <mi...@apache.org>
Committed: Thu Jun 19 14:47:28 2014 +1100

----------------------------------------------------------------------
 CHANGES.txt                                    |  1 +
 src/java/org/apache/cassandra/db/Memtable.java | 14 ++++++++++----
 2 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6131273a/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 232a860..a645516 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 1.2.17
+ * Errors in FlushRunnable may leave threads hung (CASSANDRA-7275)
  * reduce failure detector initial value to 2s (CASSANDRA-7307)
  * Fix problem truncating on a node that was previously in a dead state (CASSANDRA-7318)
  * Don't insert tombstones that hide indexed values into 2i (CASSANDRA-7268)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6131273a/src/java/org/apache/cassandra/db/Memtable.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/Memtable.java b/src/java/org/apache/cassandra/db/Memtable.java
index b6fceda..90f0466 100644
--- a/src/java/org/apache/cassandra/db/Memtable.java
+++ b/src/java/org/apache/cassandra/db/Memtable.java
@@ -380,11 +380,17 @@ public class Memtable
 
         protected void runWith(File sstableDirectory) throws Exception
         {
-            assert sstableDirectory != null : "Flush task is not bound to any disk";
+            try
+            {
+                assert sstableDirectory != null : "Flush task is not bound to any disk";
 
-            SSTableReader sstable = writeSortedContents(context, sstableDirectory);
-            cfs.replaceFlushed(Memtable.this, sstable);
-            latch.countDown();
+                SSTableReader sstable = writeSortedContents(context, sstableDirectory);
+                cfs.replaceFlushed(Memtable.this, sstable);
+            }
+            finally
+            {
+                latch.countDown();
+            }
         }
 
         protected Directories getDirectories()