hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From la...@apache.org
Subject [1/4] hbase git commit: HBASE-13601 Connection leak during log splitting. (Abhishek Singh Chouhan)
Date Fri, 01 May 2015 00:07:08 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1 dc28ded74 -> 62c55a635
  refs/heads/branch-1.0 659ff6a42 -> 402840dfe
  refs/heads/branch-1.1 6b0fbd811 -> 4b6a9d7d1
  refs/heads/master aabf6ea2f -> 235dc9734


HBASE-13601 Connection leak during log splitting. (Abhishek Singh Chouhan)


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

Branch: refs/heads/master
Commit: 235dc9734f032945331c5a4a03ff2d69d170669d
Parents: aabf6ea
Author: Lars Hofhansl <larsh@apache.org>
Authored: Thu Apr 30 17:05:05 2015 -0700
Committer: Lars Hofhansl <larsh@apache.org>
Committed: Thu Apr 30 17:05:05 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/wal/WALFactory.java     | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/235dc973/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALFactory.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALFactory.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALFactory.java
index 5dc1dde..c19f8c9 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALFactory.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/wal/WALFactory.java
@@ -278,6 +278,7 @@ public class WALFactory {
       long startWaiting = EnvironmentEdgeManager.currentTime();
       long openTimeout = timeoutMillis + startWaiting;
       int nbAttempt = 0;
+      FSDataInputStream stream = null;
       while (true) {
         try {
           if (lrClass != ProtobufLogReader.class) {
@@ -286,7 +287,7 @@ public class WALFactory {
             reader.init(fs, path, conf, null);
             return reader;
           } else {
-            FSDataInputStream stream = fs.open(path);
+            stream = fs.open(path);
             // Note that zero-length file will fail to read PB magic, and attempt to create
             // a non-PB reader and fail the same way existing code expects it to. If we get
             // rid of the old reader entirely, we need to handle 0-size files differently
from
@@ -300,6 +301,14 @@ public class WALFactory {
             return reader;
           }
         } catch (IOException e) {
+          try {
+            if (stream != null) {
+              stream.close();
+            }
+          } catch (IOException exception) {
+            LOG.warn("Could not close FSDataInputStream" + exception.getMessage());
+            LOG.debug("exception details", exception);
+          }
           String msg = e.getMessage();
           if (msg != null && (msg.contains("Cannot obtain block length")
               || msg.contains("Could not obtain the last block")


Mime
View raw message