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

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

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

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

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

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

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

And on Windows:
localhost = localhost/, w/hostname = localhost
addr = /, w/hostname =

> 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 resolves to host name "localhost".  On Windows, this
is not the case, and instead it resolves to "".

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