Skip to content

fix(registry): retry registry push with backoff on concurrent updates - #870

Merged
BYK merged 1 commit into
masterfrom
issue-869-registry-push-conflict
Aug 10, 2026
Merged

fix(registry): retry registry push with backoff on concurrent updates#870
BYK merged 1 commit into
masterfrom
issue-869-registry-push-conflict

Conversation

@jared-outpost

@jared-outpost jared-outpost Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

The Python SDK release stage failed when pushing to sentry-release-registry:

! refs/heads/master:refs/heads/master [rejected] (fetch first)
error: failed to push some refs

Root cause

In RegistryTarget.publish() the final push does pull --rebase then push wrapped in withRetry, but with default options: only 3 attempts and no delay between retries. When multiple SDK releases publish to the shared registry concurrently, the remote master advances 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 pushToRegistry helper that retries with exponential backoff (5 attempts, 3s initial delay, ×2 factor), re-pulling --rebase on each attempt so a burst of concurrent pushes has time to settle. This matches the backoff pattern already used by the crates and cocoapods targets.

Tests

Added pushToRegistry tests covering: retry-then-succeed, re-pull before each retry, and throwing after exhausting all attempts. sleep is mocked so the tests run instantly.

  • pnpm test (registry suite) — pass (8 tests)
  • tsc --noEmit — pass
  • pnpm lint — pass

Closes #869

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
@jared-outpost
jared-outpost Bot marked this pull request as ready for review August 10, 2026 15:18
@BYK
BYK merged commit 5d0ec43 into master Aug 10, 2026
21 of 22 checks passed
@BYK
BYK deleted the issue-869-registry-push-conflict branch August 10, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stage in Python SDK release failed

1 participant