cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bened...@apache.org
Subject [1/2] cassandra git commit: Fix SSTableReader.runOnClose running after dependent resources closed; bug introduced by CASSANDRA-8746
Date Tue, 24 Mar 2015 23:49:35 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 44f8254df -> 966ff2159


Fix SSTableReader.runOnClose running after dependent resources closed;
bug introduced by CASSANDRA-8746

patch by benedict; reviewed by josh for CASSANDRA-9021


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

Branch: refs/heads/trunk
Commit: c397165dcf17111c0dc54af5b4f671983590263d
Parents: 5639eac
Author: Benedict Elliott Smith <benedict@apache.org>
Authored: Tue Mar 24 23:46:29 2015 +0000
Committer: Benedict Elliott Smith <benedict@apache.org>
Committed: Tue Mar 24 23:46:29 2015 +0000

----------------------------------------------------------------------
 src/java/org/apache/cassandra/io/sstable/SSTableReader.java | 4 ++--
 src/java/org/apache/cassandra/io/util/SafeMemory.java       | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c397165d/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/SSTableReader.java b/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
index 2bc32d3..f5eef09 100644
--- a/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
+++ b/src/java/org/apache/cassandra/io/sstable/SSTableReader.java
@@ -2029,12 +2029,12 @@ public class SSTableReader extends SSTable implements SelfRefCounted<SSTableRead
                     if (barrier != null)
                         barrier.await();
                     bf.close();
-                    dfile.close();
-                    ifile.close();
                     if (summary != null)
                         summary.close();
                     if (runOnClose != null)
                         runOnClose.run();
+                    dfile.close();
+                    ifile.close();
                     typeRef.release();
                 }
             });

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c397165d/src/java/org/apache/cassandra/io/util/SafeMemory.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/util/SafeMemory.java b/src/java/org/apache/cassandra/io/util/SafeMemory.java
index 74a1f1e..45419a6 100644
--- a/src/java/org/apache/cassandra/io/util/SafeMemory.java
+++ b/src/java/org/apache/cassandra/io/util/SafeMemory.java
@@ -52,11 +52,13 @@ public class SafeMemory extends Memory implements SharedCloseable
     public void free()
     {
         ref.release();
+        peer = 0;
     }
 
     public void close()
     {
         ref.ensureReleased();
+        peer = 0;
     }
 
     public SafeMemory copy(long newSize)


Mime
View raw message