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

Bilwa S T edited comment on YARN-10310 at 6/16/20, 6:37 AM:
------------------------------------------------------------

[~eyang] Actually the verifyNoLiveAppInRM check happens before it checks 
service json from hdfs. I think you can compare the behaviour by submitting 
with user hdfs and [hdfs/[email protected].|mailto:hdfs/[email protected].] 
You can see below code
{code:java}
public ApplicationId actionCreate(Service service)
      throws IOException, YarnException {
    String serviceName = service.getName();
    ServiceApiUtil.validateAndResolveService(service, fs, getConfig());
    verifyNoLiveAppInRM(serviceName, "create");
    Path appDir = checkAppNotExistOnHdfs(service, false);

    // Write the definition first and then submit - AM will read the definition
    ServiceApiUtil.createDirAndPersistApp(fs, appDir, service);
    ApplicationId appId = submitApp(service);
    cachedAppInfo.put(serviceName, new AppInfo(appId, service
        .getKerberosPrincipal().getPrincipalName()));
    service.setId(appId.toString());
    // update app definition with appId
    ServiceApiUtil.writeAppDefinition(fs, appDir, service);
    return appId;
  }
{code}

verifyNoLiveAppInRM is called before checkAppNotExistOnHdfs . so 
verifyNoLiveAppInRM should have failed in your case . but it didnt


was (Author: bilwast):
[~eyang] Actually the verifyNoLiveAppInRM check happens before it checks 
service json from hdfs. I think you can compare the behaviour by submitting 
with user hdfs and hdfs/[email protected].

> YARN Service - User is able to launch a service with same name
> --------------------------------------------------------------
>
>                 Key: YARN-10310
>                 URL: https://issues.apache.org/jira/browse/YARN-10310
>             Project: Hadoop YARN
>          Issue Type: Bug
>            Reporter: Bilwa S T
>            Assignee: Bilwa S T
>            Priority: Major
>         Attachments: YARN-10310.001.patch
>
>
> As ServiceClient uses UserGroupInformation.getCurrentUser().getUserName() to 
> get user whereas ClientRMService#submitApplication uses 
> UserGroupInformation.getCurrentUser().getShortUserName() to set application 
> username.
> In case of user with name hdfs/[email protected]. below condition fails
> ClientRMService#getApplications()
> {code:java}
> if (users != null && !users.isEmpty() &&
>           !users.contains(application.getUser())) {
>         continue;
>  }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to