Skip to content

docs(transport): Fix stale comment referencing get_retry_after - #8333

Merged
sentrivana merged 1 commit into
masterfrom
docs/transport-retry-comment
Nov 19, 2026
Merged

sentrivana merged 1 commit into
masterfrom
docs/transport-retry-comment

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Description

This PR only changes a comment, in sentry_sdk/transport.py (HttpTransportCore.__init__, line 226). No code changes.

Old comment:

# We only use this Retry() class for the `get_retry_after` method it exposes
self._retry = urllib3.util.Retry()

Why it's inaccurate: The transport no longer calls get_retry_after. In 2bfce50d3 (#3588, the httpcore-based HTTP2Transport), the 429 handling in _update_rate_limits went from self._retry.get_retry_after(response) to reading the header with self._get_header_value(response, "Retry-After") and passing the value to self._retry.parse_retry_after(retry_after_value). The httpcore response isn't a urllib3 response, so get_retry_after(response) can't be used anymore. That same commit added this comment, but the comment names the method the commit removed. Today parse_retry_after is the only method called on self._retry (sentry_sdk/transport.py, _update_rate_limits), and get_retry_after appears nowhere in sentry_sdk/.

Fix: I kept the comment because it explains why the transport, which doesn't retry, creates a urllib3 Retry object at all. I only changed the method name to parse_retry_after.

Issues

n/a

via automation sched_7b023adc5c6d74c9739cbbdca1ed3cf8 · Run ID sched_7b023adc5c6d74c9739cbbdca1ed3cf8:1795075200000.

--

View Session [Sentry]

@sentry-junior
sentry-junior Bot requested a review from a team as a code owner November 19, 2026 08:04
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 139303 passed | ⏭️ 7857 skipped | Total: 147160 | Pass Rate: 94.66% | Execution Time: 857m 53s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -1
Passed Tests —
Failed Tests 📉 -1
Skipped Tests —

All tests are passing successfully.

✅ Patch coverage is 100.00% (no changed executable lines found; target 80%).
Project statement coverage is 90.25% (up 0.03 percentage points from base (aa7c9e1) to head (fa3b879)).

Files with missing lines (1)
File Coverage % Lines
sentry_sdk/transport.py 83.87% ⚠️ 95 Missing and 29 partials
Coverage diff
@@            Coverage Diff             @@
##        master     #8333       +/-##
==========================================
+ Coverage    90.22%    90.25%    +0.03%
==========================================
  Files          203       203         —
  Tracked lines     27333     27333         —
  Branches     10242     10242         —
==========================================
+ Hits         24660     24667        +7
+ Misses        2673      2666        -7
  Partials      1556      1556         —

Generated by Coverage Action

@sentrivana
sentrivana merged commit 4b701c0 into master Nov 19, 2026
186 checks passed
@sentrivana
sentrivana deleted the docs/transport-retry-comment branch November 19, 2026 08:31
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.

1 participant