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

Rohith Sharma K S commented on YARN-6207:
-----------------------------------------

Thanks Bibin for the patch, overall patch looks good to me. Few comments on test
# Can you move these test cases to TestCapacityScheduler? Here, you can mock 
RMApp and directly trigger scheduler event. You can also control order of 
events like AppAdded->moveApplication->AppAttemptAdded and 
AppAdded->AppAttemptAdded->AppAttemptRemoved->moveApplication->AppAttemptAdded. 
Refer {{TestCapacityScheduler}}. Scheduler module remain same and can be test 
which ever the event order to be tested.
# I personally feel NOT to use countdown latch to verify event order. The test 
code is bit confusing also since latch is created multiple times and using old 
references for countDown in some cases. Latch initialization is done at setup 
with 0 and using different references for countdown in test code.
# Below test code hangs randomly. Countdown latch should be created before 
triggering attempt removal event. The test code hang because if event 
app-attempt-added is triggered before latch creating, then *eventAdd.await();* 
will never set to 0 which hangs forever. 
{code}
// remove attempt
    app1Attempt.handle(new RMAppAttemptEvent(app1Attempt.getAppAttemptId(),
        RMAppAttemptEventType.FAIL, "Launch Fail"));
    eventAdd = new CountDownLatch(1);
    eventDone = new CountDownLatch(1);
    eventAdd.await();
{code}
# Add a test timeout. 


> Move application can  fail when attempt add event is delayed
> ------------------------------------------------------------
>
>                 Key: YARN-6207
>                 URL: https://issues.apache.org/jira/browse/YARN-6207
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: capacity scheduler
>            Reporter: Bibin A Chundatt
>            Assignee: Bibin A Chundatt
>         Attachments: YARN-6207.001.patch, YARN-6207.002.patch, 
> YARN-6207.003.patch, YARN-6207.004.patch, YARN-6207.005.patch
>
>
> *Steps to reproduce*
> 1.Submit application  and delay attempt add to Scheduler
> (Simulate using debug at EventDispatcher for SchedulerEventDispatcher)
> 2. Call move application to destination queue.
> {noformat}
> Caused by: 
> org.apache.hadoop.ipc.RemoteException(java.lang.NullPointerException): 
> java.lang.NullPointerException
>       at 
> org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler.preValidateMoveApplication(CapacityScheduler.java:2086)
>       at 
> org.apache.hadoop.yarn.server.resourcemanager.RMAppManager.moveApplicationAcrossQueue(RMAppManager.java:669)
>       at 
> org.apache.hadoop.yarn.server.resourcemanager.ClientRMService.moveApplicationAcrossQueues(ClientRMService.java:1231)
>       at 
> org.apache.hadoop.yarn.api.impl.pb.service.ApplicationClientProtocolPBServiceImpl.moveApplicationAcrossQueues(ApplicationClientProtocolPBServiceImpl.java:388)
>       at 
> org.apache.hadoop.yarn.proto.ApplicationClientProtocol$ApplicationClientProtocolService$2.callBlockingMethod(ApplicationClientProtocol.java:537)
>       at 
> org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:522)
>       at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:991)
>       at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:867)
>       at org.apache.hadoop.ipc.Server$RpcCall.run(Server.java:813)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at javax.security.auth.Subject.doAs(Subject.java:422)
>       at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1892)
>       at org.apache.hadoop.ipc.Server$Handler.run(Server.java:2659)
>       at org.apache.hadoop.ipc.Client.getRpcResponse(Client.java:1483)
>       at org.apache.hadoop.ipc.Client.call(Client.java:1429)
>       at org.apache.hadoop.ipc.Client.call(Client.java:1339)
>       at 
> org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:227)
>       at 
> org.apache.hadoop.ipc.ProtobufRpcEngine$Invoker.invoke(ProtobufRpcEngine.java:115)
>       at com.sun.proxy.$Proxy7.moveApplicationAcrossQueues(Unknown Source)
>       at 
> org.apache.hadoop.yarn.api.impl.pb.client.ApplicationClientProtocolPBClientImpl.moveApplicationAcrossQueues(ApplicationClientProtocolPBClientImpl.java:398)
>       ... 16 more
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
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