hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Nauroth (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-4783) TestDelegationTokensWithHA#testHAUtilClonesDelegationTokens fails on Windows
Date Wed, 01 May 2013 22:58:16 GMT

    [ https://issues.apache.org/jira/browse/HDFS-4783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13647034#comment-13647034
] 

Chris Nauroth commented on HDFS-4783:
-------------------------------------

I tried static resolution, but unfortunately, it didn't work.  Eventually, we get to a point
inside the RPC {{Server#Listener}} constructor where we pass through a {{ServerSocketChannel}}.
 This seems to always drop the host name from the address and re-resolve, so on Windows, this
drops "localhost" in favor of "127.0.0.1".

{code}
    public Listener() throws IOException {
      address = new InetSocketAddress(bindAddress, port);
      // Create a new server socket and set to non blocking mode
      acceptChannel = ServerSocketChannel.open();
      acceptChannel.configureBlocking(false);

      // Bind the server socket to the local host and port
      bind(acceptChannel.socket(), address, backlogLength, conf, portRangeConfig);
{code}

In the above code, even if {{bindAddress}} is "localhost" (thanks to static resolution), the
end result is still an address with host name "127.0.0.1".

Here is a very simplified version of what happens inside the bind method:

{code}
    InetSocketAddress localhost = new InetSocketAddress("localhost", 12345);
    System.out.println("localhost = " + localhost + ", w/hostname = " + localhost.getHostName());
    ServerSocketChannel ssc = ServerSocketChannel.open();
    ssc.socket().bind(localhost);
    InetSocketAddress addr = (InetSocketAddress)ssc.socket().getLocalSocketAddress();
    System.out.println("addr = " + addr + ", w/hostname = " + addr.getHostName());
{code}

Running this code on non-Windows prints:
{code}
localhost = localhost/127.0.0.1:12345, w/hostname = localhost
addr = /127.0.0.1:12345, w/hostname = localhost
{code}

And on Windows:
{code}
localhost = localhost/127.0.0.1:12345, w/hostname = localhost
addr = /127.0.0.1:12345, w/hostname = 127.0.0.1
{code}

                
> TestDelegationTokensWithHA#testHAUtilClonesDelegationTokens fails on Windows
> ----------------------------------------------------------------------------
>
>                 Key: HDFS-4783
>                 URL: https://issues.apache.org/jira/browse/HDFS-4783
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: test
>    Affects Versions: 3.0.0, 2.0.5-beta
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>         Attachments: HDFS-4783.1.patch
>
>
> This test asserts that delegation tokens previously associated to a host with a resolved
IP address no longer match for selection when hadoop.security.token.service.use_ip is set
false.  The test assumes that 127.0.0.1 resolves to host name "localhost".  On Windows, this
is not the case, and instead it resolves to "127.0.0.1".

--
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

Mime
View raw message