Skip to content
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

Return 429 Too Many Requests for gRPC error code ResourceExhausted from Trillian #1401

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

roger2hk
Copy link
Contributor

The existing HTTP status code StatusForbidden does not reflect the actual gRPC error code ResourceExhausted from Trillian. 429 Too Many Requests is a better HTTP status code to fit into the translation.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429

Checklist

@roger2hk roger2hk marked this pull request as ready for review March 20, 2024 14:06
@roger2hk roger2hk requested a review from a team as a code owner March 20, 2024 14:06
Copy link
Contributor

@mhutchinson mhutchinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this was a brand new API then I would 100% support this. Unfortunately this is an established API in a mature ecosystem, and this is a change to the implicit contract that clients may now be depending on. Is there a specific issue you're trying to address with this?

@roger2hk
Copy link
Contributor Author

There is no issue reported. I came across this when I looked at Gunnar A's question in Slack. We merged a similar PR (#1313) a while ago, so that is why I find a better CTFE HTTP status code for the rate limit error response from Trillian.

@mhutchinson
Copy link
Contributor

@AlCutter WDYT? The reason I'm hesitant with this is that we've had a lot of problems with rogue client code not backing off when we tell them to. It's been a while since we saw an influx of such bad behaviour. If we change this, it's possible that some of the clients that are currently behaving will start to misbehave.

OTOH, if we returned better status codes then it's more likely that clients will do the right thing.

@JulyMoon87
Copy link

JulyMoon87 commented Mar 20, 2024 via email

@AlCutter
Copy link
Member

Returning 429 is much more descriptive so ultimately seems like the right thing to do.

If we're worried about breaking clients with the change, perhaps we can pop this behaviour behind a flag, and try an A/B experiment for a bit to get a sense of how it'll affect traffic before deciding whether to make it default-on and remove the flag?

@roger2hk
Copy link
Contributor Author

According to this thread in ct-policy forum, the error code 429 Too Many Requests is already returned from Cloudflare and DigiCert logs. I believe monitors should have already considered the 429 Too Many Requests in the implementations.

@roger2hk
Copy link
Contributor Author

According to this thread in ct-policy forum, the error code 429 Too Many Requests is already returned from Cloudflare and DigiCert logs. I believe monitors should have already considered the 429 Too Many Requests in the implementations.

@mhutchinson WDYT?

@mhutchinson
Copy link
Contributor

According to this thread in ct-policy forum, the error code 429 Too Many Requests is already returned from Cloudflare and DigiCert logs. I believe monitors should have already considered the 429 Too Many Requests in the implementations.

@mhutchinson WDYT?

Sure, let's take the chance.

@roger2hk roger2hk merged commit 2aea376 into google:master Apr 15, 2024
6 checks passed
@roger2hk roger2hk deleted the rate-limit-http-status-code branch April 15, 2024 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants