hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vinayakumar B (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-8627) NPE thrown if unable to fetch token from Namenode
Date Mon, 29 Jun 2015 10:44:05 GMT

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

Vinayakumar B commented on HDFS-8627:
-------------------------------------

Patch looks almost okay.

Small Nit in test.
Instead of trying to read and expecting IOException as below, can directly check for the existence
of the token file. Token file should not get created in case of null token.
{code}+    Credentials.readTokenStorageFile(p, conf);{code}

> NPE thrown if unable to fetch token from Namenode
> -------------------------------------------------
>
>                 Key: HDFS-8627
>                 URL: https://issues.apache.org/jira/browse/HDFS-8627
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: J.Andreina
>            Assignee: J.Andreina
>         Attachments: HDFS-8627.1.patch
>
>
> DelegationTokenFetcher#saveDelegationToken
> Missed to check if token is null.
> {code}
>     Token<?> token = fs.getDelegationToken(renewer);
>     Credentials cred = new Credentials();
>     cred.addToken(token.getKind(), token);
> {code}
> {noformat}
> XXXXXXXXXXXXXXXXXX:~/hadoop/namenode/bin> ./hdfs fetchdt --renewer Rex /home/REX/file1
> Exception in thread "main" java.lang.NullPointerException
>         at org.apache.hadoop.hdfs.tools.DelegationTokenFetcher.saveDelegationToken(DelegationTokenFetcher.java:181)
>         at org.apache.hadoop.hdfs.tools.DelegationTokenFetcher$1.run(DelegationTokenFetcher.java:126)
>         at java.security.AccessController.doPrivileged(AccessController.java:314)
>         at javax.security.auth.Subject.doAs(Subject.java:572)
>         at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1666)
>         at org.apache.hadoop.hdfs.tools.DelegationTokenFetcher.main(DelegationTokenFetcher.java:114)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message