hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Enis Soztutar (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-6822) [WINDOWS] MiniZookeeperCluster multiple daemons bind to the same port
Date Thu, 08 Nov 2012 22:10:12 GMT

     [ https://issues.apache.org/jira/browse/HBASE-6822?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Enis Soztutar updated HBASE-6822:

       Resolution: Fixed
    Fix Version/s: 0.96.0
     Hadoop Flags: Reviewed
           Status: Resolved  (was: Patch Available)

I've committed this. Thanks Stack for the review.
> [WINDOWS] MiniZookeeperCluster multiple daemons bind to the same port
> ---------------------------------------------------------------------
>                 Key: HBASE-6822
>                 URL: https://issues.apache.org/jira/browse/HBASE-6822
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.94.3, 0.96.0
>            Reporter: Enis Soztutar
>            Assignee: Enis Soztutar
>             Fix For: 0.96.0
>         Attachments: hbase-6822_v1-0.94.patch, hbase-6822_v1-trunk.patch
> TestHBaseTestingUtility.testMiniZooKeeper() tests whether the mini zk cluster is working
by launching 5 threads corresponding to zk servers. 
> NIOServerCnxnFactory.configure() configures the socket as:
> {code}
>         this.ss = ServerSocketChannel.open();
>         ss.socket().setReuseAddress(true);
> {code}
> setReuseAddress() is set, because it allows the server to come back up and bind to the
same port before the socket is timed-out by the kernel.
> Under windows, the behavior on ServerSocket.setReuseAddress() is different than on linux,
in which it allows any process to bind to an already-bound port. This causes ZK nodes starting
on the same node, to be able to bind to the same port. 
> The following part of the patch at https://issues.apache.org/jira/browse/HADOOP-8223
deals with this case for Hadoop:
> {code}
> if(Shell.WINDOWS) {
> +      // result of setting the SO_REUSEADDR flag is different on Windows
> +      // http://msdn.microsoft.com/en-us/library/ms740621(v=vs.85).aspx
> +      // without this 2 NN's can start on the same machine and listen on 
> +      // the same port with indeterminate routing of incoming requests to them
> +      ret.setReuseAddress(false);
> +    }
> {code}
> We should do the same in Zookeeper (I'll open a ZOOK issue). But in the meantime, we
can fix hbase tests to not rely on BindException to resolve for bind errors. Especially, in
 MiniZKCluster.startup() when starting more than 1 servers, we already know that we have to
increment the port number. 

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message