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

fix: Do not retry status code 451 by default #447

Merged
merged 1 commit into from
Jul 3, 2023

Conversation

jahands
Copy link
Contributor

@jahands jahands commented Jul 3, 2023

451 is returned when a resource has been restricted for legal reasons. Retrying this status needlessly wastes API quota.
Here's an example: https://api.github.com/repos/amusi/Python3

Resolves #448


Behavior

Before the change?

API calls resulting in status code 451 would be retried
*

After the change?

API calls resulting in status code 451 are no longer retried
*

Other information


Additional info

Pull request checklist

  • [ x] Tests for the changes have been added (for bug fixes / features)
  • [ x] Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Added the appropriate label for the given change

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes (Please add the Type: Breaking change label)
  • [x ] No

If Yes, what's the impact:

  • N/A

Pull request type

Please add the corresponding label for change this PR introduces:

  • Bugfix: Type: Bug
  • Feature/model/API additions: Type: Feature
  • Updates to docs or samples: Type: Documentation
  • Dependencies/code cleanup: Type: Maintenance

@wolfy1339 wolfy1339 added the Type: Bug Something isn't working as documented label Jul 3, 2023
@jahands
Copy link
Contributor Author

jahands commented Jul 3, 2023

Test failure looks unrelated to these changes (and it passes locally.) Guessing GitHub Actions was just running a bit slower, causing the timing measured here to be off by 9ms

451 is returned when a resource has been restricted for legal reasons.
Retrying this status needlessly wastes API quota
@jahands
Copy link
Contributor Author

jahands commented Jul 3, 2023

Kicked the commit to try to get tests to run again
edit: Oh, that requires approval from a maintainer 🤦

@wolfy1339 wolfy1339 merged commit 7ae9006 into octokit:main Jul 3, 2023
@github-actions
Copy link

github-actions bot commented Jul 3, 2023

🎉 This PR is included in version 5.0.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Type: Bug Something isn't working as documented
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[BUG]: Status code 451 (blocked for legal reasons) should not be retried
2 participants