You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by nk...@apache.org on 2014/02/20 15:58:25 UTC

svn commit: r1570211 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java

Author: nkeywal
Date: Thu Feb 20 14:58:25 2014
New Revision: 1570211

URL: http://svn.apache.org/r1570211
Log:
HBASE-10520 Add handling for swallowed InterruptedException thrown by Thread.sleep in MiniZooKeeperCluster (Feng Honghua)

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java?rev=1570211&r1=1570210&r2=1570211&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java Thu Feb 20 14:58:25 2014
@@ -20,6 +20,7 @@ package org.apache.hadoop.hbase.zookeepe
 
 import java.io.BufferedReader;
 import java.io.File;
+import java.io.InterruptedIOException;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.OutputStream;
@@ -322,7 +323,7 @@ public class MiniZooKeeperCluster {
   }
 
   // XXX: From o.a.zk.t.ClientBase
-  private static boolean waitForServerDown(int port, long timeout) {
+  private static boolean waitForServerDown(int port, long timeout) throws IOException {
     long start = System.currentTimeMillis();
     while (true) {
       try {
@@ -344,14 +345,14 @@ public class MiniZooKeeperCluster {
       try {
         Thread.sleep(250);
       } catch (InterruptedException e) {
-        // ignore
+        throw (InterruptedIOException)new InterruptedIOException().initCause(e);
       }
     }
     return false;
   }
 
   // XXX: From o.a.zk.t.ClientBase
-  private static boolean waitForServerUp(int port, long timeout) {
+  private static boolean waitForServerUp(int port, long timeout) throws IOException {
     long start = System.currentTimeMillis();
     while (true) {
       try {
@@ -385,7 +386,7 @@ public class MiniZooKeeperCluster {
       try {
         Thread.sleep(250);
       } catch (InterruptedException e) {
-        // ignore
+        throw (InterruptedIOException)new InterruptedIOException().initCause(e);
       }
     }
     return false;