fix: add retry with backoff to get-version calls in version resolution#1
Open
fix: add retry with backoff to get-version calls in version resolution#1
Conversation
The get-version binary queries external APIs (GitHub for Cassandra, DockerHub for Scylla) that can return transient errors such as HTTP 403 rate limit exceeded. Previously any such failure was immediately fatal due to set -eo pipefail. Add a reusable retry() shell function (5 attempts, 10s linear backoff, ~2.5 min max wait) that wraps all get-version invocations in both resolve-cassandra-version and resolve-scylla-version targets. Retry progress messages go to stderr so they don't corrupt the version string captured via command substitution.
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
get-versioninvocations inresolve-cassandra-versionandresolve-scylla-versionMakefile targetsProblem
The
get-versionbinary queries the GitHub Tags API (for Cassandra) and DockerHub API (for Scylla) to resolve version aliases like4-LATEST. These APIs can return transient errors — notably HTTP 403 rate limit exceeded on unauthenticated GitHub API requests. Withset -eo pipefail, any such failure is immediately fatal, causing the entire CI job to fail.Example failure:
Solution
A reusable
retry()bash function defined via a Makedefineblock, injected into both version resolution targets. On failure, it retries with 10s/20s/30s/40s/50s delays (5 attempts, ~2.5 min max wait). Key properties:.ONESHELLMakefile setupTesting
Verified with 5 test scenarios:
retry cmd | tr -d '"'works (matches actual Makefile usage)Also verified via
make --dry-runthat bothresolve-cassandra-versionandresolve-scylla-versionexpand correctly.