hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wangda Tan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-1201) TestAMAuthorization fails with NullPointer when hostname has '-'
Date Thu, 17 Apr 2014 01:09:17 GMT

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

Wangda Tan commented on YARN-1201:
----------------------------------

This NPE not related whether hostname with "-" or not. It will happen when local hostname
cannot resolved, this is caused by the following code snippet
{code}
    final Configuration conf = rm.getConfig();
    final YarnRPC rpc = YarnRPC.create(conf);
    final InetSocketAddress serviceAddr = conf.getSocketAddr(
        YarnConfiguration.RM_SCHEDULER_ADDRESS,
        YarnConfiguration.DEFAULT_RM_SCHEDULER_ADDRESS,
        YarnConfiguration.DEFAULT_RM_SCHEDULER_PORT);
{code}
Mock RM will set its address to YarnConfiguration.RM_SCHEDULER_ADDRESS to its own config,
and this test called 
{code}
conf.getSocketAddr(
        YarnConfiguration.RM_SCHEDULER_ADDRESS,
        YarnConfiguration.DEFAULT_RM_SCHEDULER_ADDRESS,
        YarnConfiguration.DEFAULT_RM_SCHEDULER_PORT)
{code}
Resolve the service address from config again, if the local hostname cannot be resolved by
coincidence, test will be failed.

P.S, you can verify if you cannot resolve your local hostname by executing,
{code}
ping `hostname`
{code}
And encountered the error
{code}
ping: cannot resolve YOUR_HOST_NAME: Unknown host
{code}
The NPE will be raised.

Add a simple patch to fix this.

> TestAMAuthorization fails with NullPointer when hostname has '-'
> ----------------------------------------------------------------
>
>                 Key: YARN-1201
>                 URL: https://issues.apache.org/jira/browse/YARN-1201
>             Project: Hadoop YARN
>          Issue Type: Test
>          Components: resourcemanager
>    Affects Versions: 2.1.0-beta
>         Environment: SUSE Linux Enterprise Server 11 (x86_64)
>            Reporter: Nemon Lou
>            Assignee: Wangda Tan
>            Priority: Minor
>
> When hostname is 158-1-131-10, TestAMAuthorization fails.
> {code}
> Running org.apache.hadoop.yarn.server.resourcemanager.TestAMAuthorization
> Tests run: 4, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 14.034 sec <<<
FAILURE! - in org.apache.hadoop.yarn.server.resourcemanager.TestAMAuthorization
> testUnauthorizedAccess[0](org.apache.hadoop.yarn.server.resourcemanager.TestAMAuthorization)
 Time elapsed: 3.952 sec  <<< ERROR!
> java.lang.NullPointerException: null
>         at org.apache.hadoop.yarn.server.resourcemanager.TestAMAuthorization.testUnauthorizedAccess(TestAMAuthorization.java:284)
> testUnauthorizedAccess[1](org.apache.hadoop.yarn.server.resourcemanager.TestAMAuthorization)
 Time elapsed: 3.116 sec  <<< ERROR!
> java.lang.NullPointerException: null
>         at org.apache.hadoop.yarn.server.resourcemanager.TestAMAuthorization.testUnauthorizedAccess(TestAMAuthorization.java:284)
> Results :
> Tests in error:
>   TestAMAuthorization.testUnauthorizedAccess:284 NullPointer
>   TestAMAuthorization.testUnauthorizedAccess:284 NullPointer
> Tests run: 4, Failures: 0, Errors: 2, Skipped: 0
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message