Skip to content

response: Add "TooManyRequests" status code #59

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

Conversation

fidencio
Copy link

Reason for This PR

The addition of the "TooManyRequests" status code is in order to notify users when an operation is still pending, and this seems to be the best fit we can have for now.

On the Cloud Hypervisor side we'll use it, for instance, for the case when a caller tries to offline a vCPU but the previous offline operation is still pending, leaving at least a chance for the caller to analyse the error and decide whether they want to retry the operation or not.

TooManyRequests: https://datatracker.ietf.org/doc/html/rfc6585#section-4

Description of Changes

Just added a 429 / TooManyRequests status code.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.

PR Checklist

[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]

  • All commits in this PR are signed (git commit -s).
  • The reason for this PR is clearly provided (issue no. or explanation).
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • Any newly added unsafe code is properly documented.
  • Any user-facing changes are mentioned in CHANGELOG.md.

The addition of the "TooManyRequests" status code is in order to notify
users when an operation is still pending, and this seems to be the best
fit we can have for now.

On the Cloud Hypervisor side we'll use it, for instance, for the case
when a caller tries to offline a vCPU but the previous offline operation
is still pending, leaving at least a chance for the caller to analyse
the error and decide whether they want to retry the operation or not.

TooManyRequests: https://datatracker.ietf.org/doc/html/rfc6585#section-4

Signed-off-by: Fabiano Fidêncio <[email protected]>
@ShadowCurse ShadowCurse merged commit 4f62153 into firecracker-microvm:main Apr 25, 2025
2 checks passed
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.

3 participants