-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Changed to use more appropriate http status code for ResourceExhausted #580
Conversation
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
CLAs look good, thanks! |
Arguably the correct mapping is that defined by the Google protobuf error code proto file; |
+1, it should be 429. Could you also add a link to https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto in the function comment? |
Looks like there are more codes that should be chaged, FailedPrecondition should be |
@johanbrandhorst, If you want to send in a PR that fixes it and updates the comment on the function I'm happy to merge it today. |
My initial reason for bringing this up was that the instances in grpc-go where ResourceExhausted is currently being used are related to message size, not the resource actually being exhausted. I thought that That being said, in order to be consistent, it does make sense to map the codes based on https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto. I'll make the necessary adjustments and push a commit soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When Travis is done I'll merge. Please ping if I forget
Thanks so much @eleniums for contributing! |
grpc-ecosystem#580) * Adjust status codes to match googleapis code.proto
HTTPStatusFromCode should be mapping codes.ResourceExhausted to http.StatusRequestEntityTooLarge (https://httpstatuses.com/413) as it is the more appropriate HTTP status. The current mapping of http.StatusServiceUnavailable seems to indicate a temporary problem with the server, when in reality it is an issue with the client sending a request that is too large.