Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-6814 [WINDOWS] HBase on Windows
  3. HBASE-6825

[WINDOWS] Java NIO socket channels does not work with Windows ipv6

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.94.3, 0.95.2
    • 0.95.0
    • None
    • None
    • JDK6 on windows for ipv6.

    • Reviewed

    Description

      While running the test TestAdmin.testCheckHBaseAvailableClosesConnection(), I noticed that it takes very long, since it sleeps for 2sec * 500, because of zookeeper retries.

      The root cause of the problem is that ZK uses Java NIO to create ServerSorcket's from ServerSocketChannels. Under windows, the ipv4 and ipv6 is implemented independently, and Java seems that it cannot reuse the same socket channel for both ipv4 and ipv6 sockets. We are getting "java.net.SocketException: Address family not supported by protocol
      family" exceptions. When, ZK client resolves "localhost", it gets both v4 127.0.0.1 and v6 ::1 address, but the socket channel cannot bind to both v4 and v6.

      The problem is reported as:
      http://bugs.sun.com/view_bug.do?bug_id=6230761
      http://stackoverflow.com/questions/1357091/binding-an-ipv6-server-socket-on-windows

      Although the JDK bug is reported as resolved, I have tested with jdk1.6.0_33 without any success. Although JDK7 seems to have fixed this problem. In ZK, we can replace the ClientCnxnSocket implementation from ClientCnxnSocketNIO to a non-NIO one, but I am not sure that would be the way to go.

      Disabling ipv6 resolution of "localhost" is one other approach. I'll test it to see whether it will be any good.

      Attachments

        1. hbase-6825_v5-trunk.patch
          6 kB
          Enis Soztutar
        2. hbase-6825_v4-trunk.patch
          6 kB
          Enis Soztutar
        3. hbase-6825_v3-trunk.patch
          6 kB
          Enis Soztutar
        4. hbase-6825_v3-0.94.patch
          6 kB
          Enis Soztutar

        Issue Links

          Activity

            People

              enis Enis Soztutar
              enis Enis Soztutar
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: