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

Bilwa S T commented on YARN-10310:
----------------------------------

Hi [~eyang]
I could see that ServiceClient#submitapp adds YarnServiceConstants.APP_TYPE to 
all applications .
{code:java}
submissionContext.setQueue(queue);
submissionContext.setApplicationName(serviceName);
submissionContext.setApplicationType(YarnServiceConstants.APP_TYPE);
{code}

I debugged it and found that yarnClient.getApplications(request) fails at below 
case
{code:java}
 if (applicationTypes != null && !applicationTypes.isEmpty()) {
        String appTypeToMatch =
            StringUtils.toLowerCase(application.getApplicationType());
        if (!applicationTypes.contains(appTypeToMatch)) {
          continue;
        }
      }

      if (applicationStates != null && !applicationStates.isEmpty()) {
        if (!applicationStates.contains(application
            .createApplicationState())) {
          continue;
        }
      }

      if (users != null && !users.isEmpty() &&
          !*users.contains(application.getUser())*) {
        continue;
      }
{code}

as applicationType was same but whereas users list had hdfs/had...@hadoop.com 
and application.getuser() was hdfs. 

Yes I think we should change appType also based on parameter. currently we are 
adding yarn-service by default to all apps. Thanks


> 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/had...@hadoop.com. 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: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to