Skip to content

feat(http2): auto-expand connection pool on burst instead of erroring#71

Merged
wyeth930203 merged 4 commits into
DeepLink-org:mainfrom
wyeth93:auto_expand_connection_pool
May 28, 2026
Merged

feat(http2): auto-expand connection pool on burst instead of erroring#71
wyeth930203 merged 4 commits into
DeepLink-org:mainfrom
wyeth93:auto_expand_connection_pool

Conversation

@wyeth93
Copy link
Copy Markdown
Contributor

@wyeth93 wyeth93 commented May 26, 2026

Per-host pool now doubles capacity on demand when saturated, replacing the "Connection pool exhausted" error path. The OwnedSemaphorePermit is held alongside each PooledConnection so the semaphore truly caps live connections; expansion uses add_permits (in-place, no rebuild), guarded by Semaphore::MAX_PERMITS to avoid panics, and falls back to tokio::time::timeout(connect_timeout, acquire_owned()) to handle the race where new permits are stolen by other tasks.

  • Add PoolStats::pool_expansions and warn! log per expansion event
  • Lower default max_connections_per_host from 10 to 8 (auto-grows now)
  • Add example http2_pool_expand demonstrating 2 -> 4 -> 8 growth

Overview:

Details:

Where should the reviewer start?

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • closes GitHub issue: #xxx

Per-host pool now doubles capacity on demand when saturated, replacing
the "Connection pool exhausted" error path. The `OwnedSemaphorePermit`
is held alongside each `PooledConnection` so the semaphore truly caps
live connections; expansion uses `add_permits` (in-place, no rebuild),
guarded by `Semaphore::MAX_PERMITS` to avoid panics, and falls back to
`tokio::time::timeout(connect_timeout, acquire_owned())` to handle the
race where new permits are stolen by other tasks.

- Add `PoolStats::pool_expansions` and `warn!` log per expansion event
- Lower default `max_connections_per_host` from 10 to 8 (auto-grows now)
- Add example `http2_pool_expand` demonstrating 2 -> 4 -> 8 growth
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
crates/pulsing-actor/src/transport/http2/config.rs 75.70% <100.00%> (ø)
crates/pulsing-actor/src/transport/http2/pool.rs 97.79% <100.00%> (+11.81%) ⬆️

... and 66 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wyeth93 wyeth93 force-pushed the auto_expand_connection_pool branch from 1158f6c to f35485d Compare May 27, 2026 15:04
@wyeth930203 wyeth930203 merged commit 35000cf into DeepLink-org:main May 28, 2026
51 checks passed
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