hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-12607 TestHBaseFsck#testParallelHbck fails running against hadoop 2.6.0
Date Tue, 30 Dec 2014 17:35:54 GMT
Repository: hbase
Updated Branches:
  refs/heads/branch-1.0 97c881a55 -> 1f613bcce


HBASE-12607 TestHBaseFsck#testParallelHbck fails running against hadoop 2.6.0


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

Branch: refs/heads/branch-1.0
Commit: 1f613bcceaf5c9ff4a67f0799306094173374730
Parents: 97c881a
Author: tedyu <yuzhihong@gmail.com>
Authored: Tue Dec 30 09:35:47 2014 -0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Tue Dec 30 09:35:47 2014 -0800

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


http://git-wip-us.apache.org/repos/asf/hbase/blob/1f613bcc/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
index e08eeea..f470219 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
@@ -128,6 +128,7 @@ import org.apache.hadoop.util.Tool;
 import org.apache.hadoop.util.ToolRunner;
 import org.apache.zookeeper.KeeperException;
 
+import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Joiner;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
@@ -320,7 +321,7 @@ public class HBaseFsck extends Configured {
     errors = getErrorReporter(getConf());
     this.executor = exec;
   }
-
+  
   /**
    * This method maintains a lock using a file. If the creation fails we return null
    *
@@ -328,6 +329,7 @@ public class HBaseFsck extends Configured {
    * @throws IOException
    */
   private FSDataOutputStream checkAndMarkRunningHbck() throws IOException {
+    long start = EnvironmentEdgeManager.currentTime();
     try {
       FileSystem fs = FSUtils.getCurrentFileSystem(getConf());
       FsPermission defaultPerms = FSUtils.getFilePermissions(fs, getConf(),
@@ -345,6 +347,13 @@ public class HBaseFsck extends Configured {
       } else {
         throw e;
       }
+    } finally {
+      long duration = EnvironmentEdgeManager.currentTime() - start;
+      if (duration > 30000) {
+        LOG.warn("Took " + duration + " milliseconds to obtain lock");
+        // took too long to obtain lock
+        return null;
+      }
     }
   }
 


Mime
View raw message