hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nspiegelb...@apache.org
Subject svn commit: r1225318 - in /hbase/branches/0.89-fb/src: main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
Date Wed, 28 Dec 2011 19:40:46 GMT
Author: nspiegelberg
Date: Wed Dec 28 19:40:46 2011
New Revision: 1225318

URL: http://svn.apache.org/viewvc?rev=1225318&view=rev
Log:
[master] Fix TestZooKeeper failure

Summary:
TestZooKeeper failed in a non deterministic  way caused by the thread
interleaving.

Fixed the problem by increasing the number of retry.

Test Plan: Passed TestZooKeeper 20 times continuously.

Reviewers: kannan, pkhemani

Reviewed By: kannan

CC: hbase-eng@lists, nspiegelberg, kannan

Differential Revision: 377055

Task ID: 841280

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
    hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java?rev=1225318&r1=1225317&r2=1225318&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
Wed Dec 28 19:40:46 2011
@@ -1784,7 +1784,7 @@ public class ZooKeeperWrapper implements
    * @param e
    */
   private void abort(String why, Throwable e) {
-    LOG.error("<" + instanceName + "> is going to abort" +
+    LOG.error("<" + instanceName + "> is going to abort " +
 		"because " + why);
     this.abortable.abort(why, e);
   }

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java?rev=1225318&r1=1225317&r2=1225318&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
(original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
Wed Dec 28 19:40:46 2011
@@ -836,24 +836,23 @@ public class HBaseTestingUtility {
     nodeZK.registerListener(EmptyWatcher.instance);
     String quorumServers = nodeZK.getQuorumServers();
     int sessionTimeout = nodeZK.getSessionTimeout();
-
     byte[] password = nodeZK.getSessionPassword();
     long sessionID = nodeZK.getSessionID();
 
     ZooKeeper zk = new ZooKeeper(quorumServers,
         sessionTimeout, EmptyWatcher.instance, sessionID, password);
     zk.close();
-    final long sleep = sessionTimeout * 10L;
-    final int maxRetryNum = 5;
+		LOG.debug("ZooKeeper is closed");
+
+    final long sleep = sessionTimeout * 3L;
+    final int maxRetryNum = 10;
     int retryNum = maxRetryNum;
     while (!nodeZK.isAborted() && retryNum != 0) {
       Thread.sleep(sleep);
-      LOG.info("ZK Closed; sleeping=" + sleep);
       retryNum--;
     }
-
     if (retryNum == 0) {
-      fail("ZooKeeper is not aborted after " + maxRetryNum + " attempt");
+      fail("ZooKeeper is not aborted after " + maxRetryNum + " attempts.");
     }
   }
 



Mime
View raw message