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

rangjiaheng commented on YARN-8435:
-----------------------------------

Thanks [~giovanni.fumarola] for review, I can reproduce the exception in trunk 
code using the following test case:

 
{code:java}
@Test
public void testPipelineConcurrent() throws InterruptedException {
  final String user = "yarn";

  class ClientThread extends Thread {
    @Override public void run() {
      try {
        pipeline();
      } catch (IOException | InterruptedException e) {
        e.printStackTrace();
      }
    }

    private void pipeline() throws IOException, InterruptedException {
      UserGroupInformation.createRemoteUser(user)
          .doAs(new PrivilegedExceptionAction<ClientRequestInterceptor>() {
            @Override public ClientRequestInterceptor run() throws Exception {
              RequestInterceptorChainWrapper pipeline =
                  getRouterClientRMService().getInterceptorChain();
              ClientRequestInterceptor root = pipeline.getRootInterceptor();
              Assert.assertNotNull(root);
              System.out.println("init new interceptor for user " + user);
              return root;
            }
          });
    }
  }

  new ClientThread().start();
  Thread.sleep(1);
  new ClientThread().start();
}
{code}
 

Which out put :

 
{code:java}
Exception in thread "Thread-56" java.lang.NullPointerException
at 
org.apache.hadoop.yarn.server.router.clientrm.TestRouterClientRMService$1ClientThread$1.run(TestRouterClientRMService.java:231)
at 
org.apache.hadoop.yarn.server.router.clientrm.TestRouterClientRMService$1ClientThread$1.run(TestRouterClientRMService.java:227)
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:1683)
at 
org.apache.hadoop.yarn.server.router.clientrm.TestRouterClientRMService$1ClientThread.pipeline(TestRouterClientRMService.java:227)
at 
org.apache.hadoop.yarn.server.router.clientrm.TestRouterClientRMService$1ClientThread.run(TestRouterClientRMService.java:219)
{code}
 

YARN-8435.v1.patch can pass this test case.

 

However, this test case code is not beautiful, should I put the test case with 
YARN-8435.patch together ?

 

> NullPointerException when client first time connect to Yarn Router
> ------------------------------------------------------------------
>
>                 Key: YARN-8435
>                 URL: https://issues.apache.org/jira/browse/YARN-8435
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: router
>    Affects Versions: 2.9.0, 3.0.2
>            Reporter: rangjiaheng
>            Priority: Critical
>         Attachments: YARN-8435.v1.patch
>
>
> When Two client process (with the same user name and the same hostname) begin 
> to connect to yarn router at the same time, to submit application, kill 
> application, ... and so on, then a java.lang.NullPointerException may throws 
> from yarn router.
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to