Skip to content

Handle GitHub API timeouts while fetching org DSN#87

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

Handle GitHub API timeouts while fetching org DSN#87
cursor[bot] wants to merge 1 commit intomainfrom
cursor/sentry-error-investigation-cb7c

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented Apr 19, 2026

Summary

  • add an explicit timeout for GitHub API calls made by fetch_dsn_for_github_org
  • avoid duplicate exception logging in sentry_config
  • handle transient GitHub timeout errors in WebAppHandler by skipping trace forwarding and returning HTTP 200
  • add tests that verify timeout wiring and graceful timeout handling behavior

Root Cause

fetch_dsn_for_github_org performed requests.get without a timeout. In production, intermittent network/connectivity issues to api.github.com could block until a connect timeout and then bubble up as an exception, generating noisy 500-level failures for a non-critical telemetry-forwarding path.

Validation

  • python3 -m compileall src tests passed
  • could not run pytest in this environment (pytest module not installed)

Risk

Low. Changes are scoped to DSN fetch and timeout handling; the webhook path continues to process events and now degrades gracefully on transient GitHub timeouts.

Open in Web View Automation 

Co-authored-by: Armen Zambrano G. <armenzg@users.noreply.github.com>
Comment thread src/sentry_config.py
resp.raise_for_status()
meta = resp.json()
# - Get meta about sentry_config.ini file
resp = requests.get(api_url, headers=headers, timeout=GH_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