[rubysrc2cpg] Retry ruby_ast_gen download on HTTP errors - #6265
Merged
Merged
Conversation
Use DownloadHelper.ensureIsAvailable (backed by UrlRetry with exponential backoff) in astGenResourceTask instead of a single-shot urlInputStream transfer, matching the other frontends' astgen downloads.
ml86
approved these changes
Sep 8, 2026
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.
Motivation
We've seen transient HTTP errors fail the build during
rubysrc2cpg'sastGenResourceTask, which downloaded theruby_ast_genzip via a single-shoturlInputStream+IO.transferwith no retry logic.Change
Route the download through
DownloadHelper.ensureIsAvailable(backed byUrlRetry.downloadWithRetries: 5 attempts, exponential backoff, non-2xx status check) — the same helper already used byjoernTypeStubsDlTaskand all other frontends' astgen downloads.Behavior is otherwise unchanged: the download still only happens when the unpacked astgen version doesn't match, and the zip is still deleted after unzipping. Since the URL bookkeeping in
.local/source-urlsis only written after a successful download, a failed attempt always triggers a fresh retry on the next build.Verification
version.rb, then ransbt rubysrc2cpg/astGenResourceTask: download went throughensureIsAvailable([INFO] downloading ...), unzip + zip cleanup succeeded..sbtfiles for raw download primitives (urlInputStream,IO.transfer,toURL,openStream,curl/wget): no remaining occurrences — every build-time HTTP download in the repo now goes through the retrying helper.