fix(registry): retry registry push with backoff on concurrent updates - #870
Merged
Conversation
Concurrent SDK releases can push to sentry-release-registry's master between our pull --rebase and push, causing a non-fast-forward rejection that fails the stage. The existing retry had no backoff, so retries kept racing the same burst. Add exponential backoff (5 attempts) matching the crates/cocoapods targets, re-pulling each attempt so the burst can settle. Fixes #869
BYK
approved these changes
Aug 10, 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.
Summary
The Python SDK release stage failed when pushing to
sentry-release-registry:Root cause
In
RegistryTarget.publish()the final push doespull --rebasethenpushwrapped inwithRetry, but with default options: only 3 attempts and no delay between retries. When multiple SDK releases publish to the shared registry concurrently, the remotemasteradvances between our pull and push, so the push is rejected. With zero backoff the retries keep racing the same burst of concurrent pushes and all lose, failing the stage.Fix
Extract the push into a
pushToRegistryhelper that retries with exponential backoff (5 attempts, 3s initial delay, ×2 factor), re-pulling--rebaseon each attempt so a burst of concurrent pushes has time to settle. This matches the backoff pattern already used by thecratesandcocoapodstargets.Tests
Added
pushToRegistrytests covering: retry-then-succeed, re-pull before each retry, and throwing after exhausting all attempts.sleepis mocked so the tests run instantly.pnpm test(registry suite) — pass (8 tests)tsc --noEmit— passpnpm lint— passCloses #869