[ 
https://issues.apache.org/jira/browse/YARN-1919?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tsuyoshi OZAWA updated YARN-1919:
---------------------------------

    Attachment: YARN-1919.1.patch

I faced the problem and looked at the cause of the NullPointerException. It 
happens as follows:

1. {{String clusterId = YarnConfiguration.getClusterId(conf);}} in 
{{EmbeddedElectorService#serviceInit}} throws the 
HadoopIllegalArgumentException with messages.
2. {{AbstractService#serviceInit}} handles the Exception and calls 
{{ServiceOperations.stopQuietly}} in the exception handler.
3. {{EmbeddedElectorService#serviceStop()}} is called, but the field 
{{elector}} is not initialized.

The attached patch to fix it. The error message is changed with the patch:
{quote}
2014-06-11 22:27:23,999 INFO org.apache.hadoop.service.AbstractService: Service 
org.apache.hadoop.yarn.server.resourcemanager.EmbeddedElectorService failed in 
state INITED; cause: org.apache.hadoop.HadoopIllegalArgumentException: 
Configuration doesn't specify yarn.resourcemanager.cluster-id
org.apache.hadoop.HadoopIllegalArgumentException: Configuration doesn't specify 
yarn.resourcemanager.cluster-id
        at 
org.apache.hadoop.yarn.conf.YarnConfiguration.getClusterId(YarnConfiguration.java:1350)
        at 
org.apache.hadoop.yarn.server.resourcemanager.EmbeddedElectorService.serviceInit(EmbeddedElectorService.java:76)
        at 
org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
        at 
org.apache.hadoop.service.CompositeService.serviceInit(CompositeService.java:107)
        at 
org.apache.hadoop.yarn.server.resourcemanager.AdminService.serviceInit(AdminService.java:125)
        at 
org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
        at 
org.apache.hadoop.service.CompositeService.serviceInit(CompositeService.java:107)
        at 
org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.serviceInit(ResourceManager.java:232)
        at 
org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
        at 
org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.main(ResourceManager.java:1039)
{quote}

[~kkambatl],  Can I take over this JIRA and could you help me by reviewing the 
patch? 

> Log yarn.resourcemanager.cluster-id is required for HA instead of throwing NPE
> ------------------------------------------------------------------------------
>
>                 Key: YARN-1919
>                 URL: https://issues.apache.org/jira/browse/YARN-1919
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: resourcemanager
>    Affects Versions: 2.3.0
>            Reporter: Devaraj K
>            Assignee: Karthik Kambatla
>            Priority: Minor
>         Attachments: YARN-1919.1.patch
>
>
> {code:xml}
> 2014-04-09 16:14:16,392 WARN org.apache.hadoop.service.AbstractService: When 
> stopping the service 
> org.apache.hadoop.yarn.server.resourcemanager.EmbeddedElectorService : 
> java.lang.NullPointerException
> java.lang.NullPointerException
>       at 
> org.apache.hadoop.yarn.server.resourcemanager.EmbeddedElectorService.serviceStop(EmbeddedElectorService.java:108)
>       at 
> org.apache.hadoop.service.AbstractService.stop(AbstractService.java:221)
>       at 
> org.apache.hadoop.service.ServiceOperations.stop(ServiceOperations.java:52)
>       at 
> org.apache.hadoop.service.ServiceOperations.stopQuietly(ServiceOperations.java:80)
>       at 
> org.apache.hadoop.service.AbstractService.init(AbstractService.java:171)
>       at 
> org.apache.hadoop.service.CompositeService.serviceInit(CompositeService.java:107)
>       at 
> org.apache.hadoop.yarn.server.resourcemanager.AdminService.serviceInit(AdminService.java:122)
>       at 
> org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
>       at 
> org.apache.hadoop.service.CompositeService.serviceInit(CompositeService.java:107)
>       at 
> org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.serviceInit(ResourceManager.java:232)
>       at 
> org.apache.hadoop.service.AbstractService.init(AbstractService.java:163)
>       at 
> org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.main(ResourceManager.java:1038)
> {code}



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

Reply via email to