fix: add retry with backoff to _fetch_closed_issues for transient 5xx errors#394
Open
t7929375-eng wants to merge 1 commit intoentrius:testfrom
Open
fix: add retry with backoff to _fetch_closed_issues for transient 5xx errors#394t7929375-eng wants to merge 1 commit intoentrius:testfrom
t7929375-eng wants to merge 1 commit intoentrius:testfrom
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.
Problem
_fetch_closed_issues()inrepo_scan.pyhas no retry logic. A single transient 502/503/504 from GitHub causes the function to immediatelybreakand return partial results, silently losing all issues from subsequent pages.This is inconsistent with every other API function in the codebase:
get_pull_request_file_changes— 3 retries with exponential backoffget_pull_request_maintainer_changes_requested_count— 3 retriesexecute_graphql_query— 8 retries with backoffget_merge_base_sha— 3 retriesget_github_user— 6 retriesImpact
When GitHub returns a transient 5xx during the issue discovery scan, the validator loses visibility into all remaining closed issues for that repo. If this happens on a high-weight repo early in the scan, miner-authored issues are silently missed, incorrectly reducing their
solved_countandissue_credibility.Solution
Add retry logic with exponential backoff (3 attempts, capped at 30s) for 5xx errors and connection exceptions, matching the established pattern. Non-retryable errors (404, 422) still return immediately without retry.
Type of Change
Testing
ruff checkpassesruff formatpassespyrightpassesChecklist
cc @anderdc @LandynDev