fix(github): stop retrying permanent GraphQL client errors#1529
Open
cleanjunc wants to merge 2 commits into
Open
fix(github): stop retrying permanent GraphQL client errors#1529cleanjunc wants to merge 2 commits into
cleanjunc wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
execute_graphql_queryretried on any response other than 200, so a permanent client failure such as bad credentials or forbidden access consumed the entire retry budget on backoff sleeps before returningNone. No retry can change the outcome of those errors, and the REST helpers in the same module already fail fast on them.This change adds a shared
_is_retryable_responsehelper. Transient conditions (rate limiting, request timeout, and server errors) keep being retried with backoff, while permanent client errors return immediately with the real status logged.get_github_identitynow reuses the same helper, which removes the duplicated status handling it carried before._is_rate_limited_responsealso recognizes secondary rate limits and abuse detection through theRetry-Afterheader or the response message, so those stay retryable.Related Issues
Fixes #1528
Type of Change
Testing
Added cases in
tests/utils/test_github_api_tools.pycovering fast fail on auth and forbidden responses, continued retries for rate limiting, secondary rate limits, abuse detection, and server errors, plus the success path. The full module suite and the related validator suites pass (94 tests).Checklist