hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daryn Sharp (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-7510) Tokens should use original hostname provided instead of ip
Date Wed, 31 Aug 2011 19:26:10 GMT

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

Daryn Sharp commented on HADOOP-7510:

> URI uri = hasScheme ? URI.create(target) : URI.create("host://"+target);
If hasScheme is false, the host is used as a scheme? Is it a typo?

The scheme "host" (not a variable) is used as a dummy scheme to allow the authority to subsequently
be parsed out.

> NetUtils#makeSocketAddr
InetSocketAddress#getHostName javadoc states that hostname part of the address is returned.
How can we assume that an IP address will be returned even if it is resolved?

{{InetSocketAddress#getHostName}} returns the hostname within the embedded {{InetAddress}}.
 If instantiated with an ip, the {{InetAddress}} has a null hostname which causes the ip to
be resolved when the hostname is requested.  We don't want this behavior.  If {{InetSocketAddress}}
is instantiated with an ip, then the ip must be returned so the reconnect uses the ip and
not the host from a reverse lookup.

The trick is to instantiate an {{InetAddress}} with an exact hostname (whether ip or host)
and it's ip -- this prevents any dns lookups when {{getHostName}} is invoked.  Then instantiate
an {{InetSocketAddress}} with that {{InetAddress}}.  Now {{getHostName}} is locked down to
return the given hostname (whether ip or host).

Here is the relevant code:
iaddr = InetAddress.getByAddress(hostname, iaddr.getAddress());
socketAddr = new InetSocketAddress(iaddr, port);

> DistributedFileSystem.java
Please don't remove the deprecated method. I think deprecated methods should be removed only
in major releases.

No problem, I'll add it back.

> Tokens should use original hostname provided instead of ip
> ----------------------------------------------------------
>                 Key: HADOOP-7510
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7510
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: security
>            Reporter: Daryn Sharp
>            Assignee: Daryn Sharp
>             Fix For:
>         Attachments: HADOOP-7510.patch
> Tokens currently store the ip:port of the remote server.  This precludes tokens from
being used after a host's ip is changed.  Tokens should store the hostname used to make the
RPC connection.  This will enable new processes to use their existing tokens.

This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message