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

Daryn Sharp commented on HADOOP-7602:
-------------------------------------

I don't agree with the re-introducing buggy behavior to low-level token methods 
to account for a bad interaction between the {{TokenCache}} and 
{{HarFileSystem}}.  The token methods are called in many other places that 
cannot tolerate an empty string.  Allowing an empty string to be returned for 
invalid input in _any_ other context will result in onerous exceptions like 
those being fixed, unusable tokens, or silent token renewal failures.

The root issue is that {{TokenCache.obtainTokensForNamenodes}} calls 
{{getCanonicalServiceName}} to use as the key for the credentials map.  
{{getCanonicalServiceName}} is expected to return the "ip:port" authority.  The 
{{HarFileSystem}} has no or an invalid authority, because it has no tokens, so 
it relied on the low-level token methods to return an empty string on bad 
input.  It should never have gotten that far, so John made it return an empty 
string immediately instead of relying on bad behavior in the low-level token 
methods.

In effect, har now behaves exactly the same way as it does in 204 w/o relying 
on bugs.  Excuse me for repeating:  Allowing an empty string to be returned for 
invalid input in _any_ other context will result in onerous exceptions like 
those being fixed, unusable tokens, or silent token renewal failures.


> wordcount, sort etc on har files fails with NPE
> -----------------------------------------------
>
>                 Key: HADOOP-7602
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7602
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.20.205.0, 0.20.206.0
>            Reporter: John George
>            Assignee: John George
>             Fix For: 0.20.205.0
>
>         Attachments: hadoop-7602.1.patch, hadoop-7602.2.patch, 
> hadoop-7602.3.patch, hadoop-7602.4.patch, hadoop-7602.daryns_comment.2.patch, 
> hadoop-7602.daryns_comment.patch, hadoop-7602.patch
>
>
> wordcount, sort etc on har files fails with 
> NPE@createSocketAddr(NetUtils.java:137). 

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

        

Reply via email to