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] [Commented] (HBASE-6825) [WINDOWS] Java NIO socket channels does not work with Windows ipv6
Date Wed, 23 Jan 2013 19:49:13 GMT

    [ https://issues.apache.org/jira/browse/HBASE-6825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13561015#comment-13561015

Enis Soztutar commented on HBASE-6825:

bq. If I'm not mistaken, the test uses a fixed port 8502, this should be changed, if not we
can have random failures when running the test suites.
That part of the test mimics the test in the java bug report (http://bugs.sun.com/view_bug.do?bug_id=6230761).
I think it checks for BindException's and just passes, assuming an optimistic test. I agree
that I should change the fixed port. 
bq. For the issue itself, why should it not make it to the main code? I mean, we test that,
on windows, a critical feature works. If not we will have issues. This should be in main,
not in test, no?
Sorry, I failed to give enough context here. In the original patches, we did have a change
for passing -Djava.net.preferIPv4Stack=true in the bin/hbase.cmd script. But I removed that
one so that this patch would not depend on HBASE-6815. In the actual patch for HBASE-6815,
we are passing preferipv4 to the hbase daemons through hbase.cmd script. In hbase-env.cmd:
+@rem Extra Java runtime options.
+@rem Below are what we set by default.  May only work with SUN JVM.
+@rem For more on why as well as other possible settings,
+@rem see http://wiki.apache.org/hadoop/PerformanceTuning
+@rem JDK6 on Windows has a known bug for IPv6, use preferIPv4Stack unless JDK7.
+@rem @rem See TestIPv6NIOServerSocketChannel.
+set HBASE_OPTS="-XX:+UseConcMarkSweepGC" "-Djava.net.preferIPv4Stack=true"

bq. And actually, this seems to be fixed in 1.6 u34 says http://www.oracle.com/technetwork/java/javase/documentation/overview-156328.html.
Let me test this one. After HBASE-7301, we are running the tests with ipv4 on linux anyway,
so we might as well commit this one regardless. 

> [WINDOWS] Java NIO socket channels does not work with Windows ipv6
> ------------------------------------------------------------------
>                 Key: HBASE-6825
>                 URL: https://issues.apache.org/jira/browse/HBASE-6825
>             Project: HBase
>          Issue Type: Sub-task
>    Affects Versions: 0.94.3, 0.96.0
>         Environment: JDK6 on windows for ipv6. 
>            Reporter: Enis Soztutar
>            Assignee: Enis Soztutar
>         Attachments: hbase-6825_v3-0.94.patch, hbase-6825_v3-trunk.patch
> 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 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. 

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