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

Miklos Szegedi commented on YARN-7689:
--------------------------------------

Thank you for the patch [~wilfreds].
{code}
// If re-init is called before init the manager is null and the RM
// will crash, this happens in a number of tests.
{code}
I would say "Protect against uninitialized scheduling monitor manager"
In general I would try to update the test to call the init. The reason is that 
this check may hide important race conditions in the future and will lead the 
code crash later or miss monitoring due to an uninitialized monitor manager.

> TestRMContainerAllocator fails after YARN-6124
> ----------------------------------------------
>
>                 Key: YARN-7689
>                 URL: https://issues.apache.org/jira/browse/YARN-7689
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: scheduler
>    Affects Versions: 3.1.0
>            Reporter: Wilfred Spiegelenburg
>            Assignee: Wilfred Spiegelenburg
>         Attachments: YARN-7689.001.patch
>
>
> After the change that was made for YARN-6124 multiple tests in the 
> TestRMContainerAllocator from MapReduce fail with the following NPE:
> {code}
> java.lang.NullPointerException
>       at 
> org.apache.hadoop.yarn.server.resourcemanager.scheduler.AbstractYarnScheduler.reinitialize(AbstractYarnScheduler.java:1437)
>       at 
> org.apache.hadoop.yarn.server.resourcemanager.scheduler.fifo.FifoScheduler.reinitialize(FifoScheduler.java:320)
>       at 
> org.apache.hadoop.mapreduce.v2.app.rm.TestRMContainerAllocator$ExcessReduceContainerAllocateScheduler.<init>(TestRMContainerAllocator.java:1808)
>       at 
> org.apache.hadoop.mapreduce.v2.app.rm.TestRMContainerAllocator$MyResourceManager2.createScheduler(TestRMContainerAllocator.java:970)
>       at 
> org.apache.hadoop.yarn.server.resourcemanager.ResourceManager$RMActiveServices.serviceInit(ResourceManager.java:659)
>       at 
> org.apache.hadoop.service.AbstractService.init(AbstractService.java:164)
>       at 
> org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.createAndInitActiveServices(ResourceManager.java:1133)
>       at 
> org.apache.hadoop.yarn.server.resourcemanager.ResourceManager.serviceInit(ResourceManager.java:316)
>       at 
> org.apache.hadoop.yarn.server.resourcemanager.MockRM.serviceInit(MockRM.java:1334)
>       at 
> org.apache.hadoop.service.AbstractService.init(AbstractService.java:164)
>       at 
> org.apache.hadoop.yarn.server.resourcemanager.MockRM.<init>(MockRM.java:162)
>       at 
> org.apache.hadoop.yarn.server.resourcemanager.MockRM.<init>(MockRM.java:141)
>       at 
> org.apache.hadoop.yarn.server.resourcemanager.MockRM.<init>(MockRM.java:137)
>       at 
> org.apache.hadoop.mapreduce.v2.app.rm.TestRMContainerAllocator$MyResourceManager.<init>(TestRMContainerAllocator.java:928)
> {code}
> In the test we just call reinitiaize on a scheduler and never call init.
> The stop of the service is guarded and so should the start and the re-init.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to