Skip to content

ref(integrations): Default max_retries to zero - #127255

Merged
cmanallen merged 4 commits into
masterfrom
cmanallen/base-retries-to-zero
Oct 13, 2026
Merged

cmanallen merged 4 commits into
masterfrom
cmanallen/base-retries-to-zero

Conversation

@cmanallen

@cmanallen cmanallen commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

requests.adapters.HTTPAdapter handles the max_retries parameter like so:

if max_retries == DEFAULT_RETRIES:
    self.max_retries = Retry(0, read=False)
else:
    self.max_retries = Retry.from_int(max_retries)

The DEFULAT_RETRIES constant is set to 0 at the top of the file. The condition is falsey when specified as None and sets max_retries to the result of Retry.from_int(None). Importing urllib3 and inspecting the output reveals the following:

>>> from urllib3.util.retry import Retry
>>> r = Retry.from_int(None)
>>> r
Retry(total=3, connect=None, read=None, redirect=None, status=None)

This is clearly not the intent of max_retries=None. We should explicitly coerce None to 0. This presents as four botched connections to a slow service as seen here: https://sentry.sentry.io/explore/traces/trace/261e7f32d8374953a95768436e6f61d2?node=span-b8c91fc7944e2287. The control silo will hold the process open for the 40 second duration (10s per connection). However, the cell silo has already closed its connection after its 10 second timeout. Meaning even if these requests did resolve they would have not been able to return anyway.

I'm only applying this change to the base client because its the one actually reaching out to GitHub et al. Proxy clients are still allowed to retry.

@cmanallen
cmanallen requested review from a team as code owners October 13, 2026 14:43
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 13, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 85aec8d. Configure here.

@markstory markstory left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. Using an option is a great idea.

@cmanallen
cmanallen merged commit 6f44880 into master Oct 13, 2026
87 checks passed
@cmanallen
cmanallen deleted the cmanallen/base-retries-to-zero branch October 13, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants