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

Gour Saha commented on YARN-7202:
---------------------------------

{quote}
the problem with NOT_FOUND is that ApplicationNotFoundException is thrown when 
the YARN application is not running. So it can occur when the service exists 
but is stopped, which is confusing.
{quote}
Right, and that is exactly why these codes were introduced to differentiate 
between all the scenarios. Looks like the implementation to set the codes 
appropriately, were removed.
{code}
  Integer ERROR_CODE_APP_DOES_NOT_EXIST = 404001;
  Integer ERROR_CODE_APP_IS_NOT_RUNNING = 404002;
  Integer ERROR_CODE_APP_SUBMITTED_BUT_NOT_RUNNING_YET = 404003;
  Integer ERROR_CODE_APP_NAME_INVALID = 404004;
{code}

{quote}
In the NO_CONTENT case, I found it strange that all the other responses for 
updateService return OK, while stop returns NO_CONTENT. Also, NO_CONTENT is 
returned when updateService performs no action, so you can't tell the 
difference between a successful stop and the call not doing anything. Perhaps 
stopService should be returning OK with a ServiceStatus object.
{quote}
If there is no payload sent as a response for successful cases, then sending OK 
is unnecessarily forcing the client to look for data and finding that there 
isn't any. Since there are so many different types of updates a service can go 
through for a PUT call (and possibly support multiple updates in a single 
call), it will be difficult to provide any meaningful data to express what PUT 
actually did OR that a PUT actually did nothing. The idea behind a NO_CONTENT 
is that the client's request has been successful (or successfully did nothing), 
and the expectation is that the client needs to do a subsequent GET to find the 
details and the current state of the service.

> Add UT for api-server
> ---------------------
>
>                 Key: YARN-7202
>                 URL: https://issues.apache.org/jira/browse/YARN-7202
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>            Reporter: Jian He
>            Assignee: Eric Yang
>             Fix For: yarn-native-services
>
>         Attachments: YARN-7202.yarn-native-services.001.patch, 
> YARN-7202.yarn-native-services.002.patch, 
> YARN-7202.yarn-native-services.003.patch, 
> YARN-7202.yarn-native-services.004.patch, 
> YARN-7202.yarn-native-services.005.patch, 
> YARN-7202.yarn-native-services.006.patch, 
> YARN-7202.yarn-native-services.007.patch, 
> YARN-7202.yarn-native-services.008.patch, 
> YARN-7202.yarn-native-services.011.patch, 
> YARN-7202.yarn-native-services.012.patch, 
> YARN-7202.yarn-native-services.013.patch, 
> YARN-7202.yarn-native-services.014.patch
>
>




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

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

Reply via email to