[ 
https://issues.apache.org/jira/browse/YUNIKORN-2163?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Wilfred Spiegelenburg resolved YUNIKORN-2163.
---------------------------------------------
    Fix Version/s: 1.5.0
       Resolution: Fixed

REST response updated in 1.5.0, should add release note for this so external 
consumer understand the changes.

> Fix HTTP status codes in some REST handlers
> -------------------------------------------
>
>                 Key: YUNIKORN-2163
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-2163
>             Project: Apache YuniKorn
>          Issue Type: Sub-task
>          Components: core - common
>            Reporter: Peter Bacsko
>            Assignee: Peter Bacsko
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.5.0
>
>
> In the REST interface, sometimes we return 400 Bad request instead of a more 
> appropriate 5xx like Internal server error (500). 4xx codes are 
> client-related errors, ie something is wrong with the request. However, if 
> the request itself is valid but cannot be fulfilled, it's better to use a 
> server-related status code.
> There are other status codes which do not follow the meaning of the code and 
> what to use instead:
> * An object (queue, partition, user, etc) does not exist: 400 Bad Request --> 
> 404 Not Found
> * Internal metrics is disabled: 501 Not Implemented --> 500 Internal Server 
> Error
> * Event tracking disabled: 400 Bad Request --> 500 Internal Server Error
> 400 means that the request is malformed, eg. header or the request syntax is 
> invalid.
> It's better to return 404 when an object is not found, because in this case, 
> the request itself is properly formatted. The real problem is that it refers 
> to a resource which does not exist.
> 501 Not Implemented refers to a HTTP method (GET, POST, etc), not a 
> functionality in the business logic.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@yunikorn.apache.org
For additional commands, e-mail: dev-h...@yunikorn.apache.org

Reply via email to