hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r1523810 - /hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java
Date Mon, 16 Sep 2013 21:04:45 GMT
Author: jdcryans
Date: Mon Sep 16 21:04:44 2013
New Revision: 1523810

URL: http://svn.apache.org/r1523810
Log:
HBASE-9425 Starting a LocalHBaseCluster when 2181 is occupied results in "Too many open files"

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

Modified: hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java?rev=1523810&r1=1523809&r2=1523810&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java
(original)
+++ hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/zookeeper/MiniZooKeeperCluster.java
Mon Sep 16 21:04:44 2013
@@ -134,7 +134,8 @@ public class MiniZooKeeperCluster {
   /**
    * @param baseDir
    * @param numZooKeeperServers
-   * @return ClientPort server bound to.
+   * @return ClientPort server bound to, -1 if there was a
+   *         binding problem and we couldn't pick another port.
    * @throws IOException
    * @throws InterruptedException
    */
@@ -169,7 +170,9 @@ public class MiniZooKeeperCluster {
               1000));
         } catch (BindException e) {
           LOG.debug("Failed binding ZK Server to client port: " +
-              tentativePort);
+              tentativePort, e);
+          // We're told to use some port but it's occupied, fail
+          if (defaultClientPort > 0) return -1;
           // This port is already in use, try to use another.
           tentativePort = selectClientPort();
           continue;



Mime
View raw message