-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating HTTP status code documentation to use 404 instead of 503 #1151
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: robscott The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
cc @mikemorris |
I thought the reason we specified a 503 originally is that it allows users to tell that the error is originating from something in the path rather than the end app? Personally, I would expect a 404 to mean that the request got to the end app and then it wasn't found, not that the proxy is misconfigured. I guess another way to put this is: If we're sending 404s for misconfigurations, how will the app dev know that those 404s are not supposed to happen? 503s are used because they are a signal that something is wrong, and someone needs to take some action. |
Meant to link the context from Slack.
I think it's useful to think about what an implementation should do when a matching route rule does not exist. I think that a 404 is the most appropriate response in that case. The question then becomes if we should return different HTTP status code if someone has tried and failed to attach a Route. My thought is that failed attempts to attach a Route should be treated the same as if the Route was not attached to the Gateway. I think the same logic applies when a BackendRef is not valid/resolvable. For reference here are the RFC 7231 definitions of the HTTP status codes:
Although neither seem like a perfect fit here, 404 seems more accurate to me. |
Another use case that we should document - Service exists and is valid to reference but no healthy endpoints. |
Also cover unsupported types. |
Updated to account for feedback from today's community meeting. |
After the discussion in our meeting, I'm behind this change. /lgtm |
Seems like we had consensus at community meeting. /hold cancel |
Sorry for not looking at this closely earlier - the part that feels a bit strange to me with this change is
Because (I think?) some sort of route would have been matched for the logic to reach the backend weighting, and if some backends are valid, retrying the request could potentialy reach a live backend (closer to 503 logic). This could be tricky for some implementations to differentiate (as it might require some sort of health monitoring of backends), but I think what I would expect is:
|
What type of PR is this?
/kind documentation
/kind api-change
/area conformance
What this PR does / why we need it:
As suggested by @michaelbeaumont, this updates our HTTP status code guidance to require 404 status codes and removes any recommendations to return 503 status codes.
Does this PR introduce a user-facing change?:
Adding a hold for consensus.
/hold