Skip to content

perf: split connect/read timeout; larger connection pool#30

Merged
cnewkirk merged 1 commit into
mainfrom
perf/timeout-and-pool
Mar 8, 2026
Merged

perf: split connect/read timeout; larger connection pool#30
cnewkirk merged 1 commit into
mainfrom
perf/timeout-and-pool

Conversation

@cnewkirk

@cnewkirk cnewkirk commented Mar 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Split timeout: _timeout is now stored as (min(timeout, 10), timeout) — connect timeout capped at 10 s so unreachable hosts fail fast; read timeout stays at the user-configured value. Fully transparent to callers.
  • Larger pool: HTTPAdapter always mounted with pool_connections=4, pool_maxsize=20. Helps users who parallelize via ThreadPoolExecutor without any API changes.
  • Test updated for retries=0 path (now mounts our adapter instead of urllib3 default; max_retries=0 behaviour unchanged).

Test plan

  • 490 tests passing

🤖 Generated with Claude Code

- _timeout stored as (connect, read) tuple: connect capped at
  min(timeout, 10)s so unreachable hosts fail fast; read uses the
  full configured timeout. Transparent to callers — timeout parameter
  unchanged.
- HTTPAdapter always mounted (even retries=0) with pool_connections=4
  and pool_maxsize=20, improving throughput for concurrent callers
  using ThreadPoolExecutor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cnewkirk
cnewkirk merged commit f6fd8b2 into main Mar 8, 2026
12 checks passed
@cnewkirk cnewkirk mentioned this pull request Mar 8, 2026
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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