Move latch.countDown() into "finally" block

patch by Mikhail Stepura; reviewed by Tyler Hobbs for CASSANDRA-7275
This commit is contained in:
Mikhail Stepura 2014-06-11 15:19:22 -07:00
parent ea837970be
commit 6131273ac6
2 changed files with 11 additions and 4 deletions

View File

@ -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)

View File

@ -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()