Skip to content

Add timeout and retries for DSN config fetch from GitHub API#93

Draft
cursor[bot] wants to merge 1 commit intomainfrom
cursor/sentry-error-investigation-b892
Draft

Add timeout and retries for DSN config fetch from GitHub API#93
cursor[bot] wants to merge 1 commit intomainfrom
cursor/sentry-error-investigation-b892

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented Apr 22, 2026

Summary

Hardened DSN config fetch in src/sentry_config.py against transient GitHub network failures that were causing ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')).

Changes

  • Added bounded timeout and retry behavior for the GitHub API request used by fetch_dsn_for_github_org.
  • Added exponential backoff between retries.
  • Kept retry scope narrow to transient network exceptions (ConnectionError, Timeout).
  • Added focused tests in tests/test_sentry_config_file.py:
    • retries once and succeeds after a transient ConnectionError
    • raises after retries are exhausted
    • verifies timeout is applied to all attempts

Validation

  • python3 -m pytest tests/test_sentry_config_file.py -q
  • python3 -m pytest tests/test_sentry_config_file.py tests/test_web_app_handler.py -q

Sentry context

  • Issue: SENTRY-GITHUB-ACTIONS-APP-63
  • Signature: ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
  • Failing frame: src/sentry_config.py in fetch_dsn_for_github_org
Open in Web View Automation 

Co-authored-by: Armen Zambrano G. <armenzg@users.noreply.github.com>
Comment thread src/sentry_config.py
Comment on lines +29 to +33
return requests.get(
url,
headers=headers,
timeout=GITHUB_API_TIMEOUT_SECONDS,
)
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.

2 participants