Skip to content

Add H2 connection pool with per-authority multiplexing#4487

Open
muhamadazmy wants to merge 3 commits intorestatedev:mainfrom
muhamadazmy:pr4487
Open

Add H2 connection pool with per-authority multiplexing#4487
muhamadazmy wants to merge 3 commits intorestatedev:mainfrom
muhamadazmy:pr4487

Conversation

@muhamadazmy
Copy link
Contributor

@muhamadazmy muhamadazmy commented Mar 13, 2026

Add H2 connection pool with per-authority multiplexing

Summary

  • Add AuthorityPool that manages multiple H2 connections to a single authority (scheme+host+port), creating connections on demand when streams are exhausted and evicting failed ones
  • Add Pool that routes requests to the correct AuthorityPool via a DashMap<ConnectionInfo, AuthorityPool>
  • Add PoolBuilder with configurable max_connections and init_max_streams per authority

Stack created with Sapling. Best reviewed with ReviewStack.

@claude
Copy link

claude bot commented Mar 17, 2026

⚠️ Code review skipped — your organization's overage spend limit has been reached.

Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit in Settings → Usage.

Once credits are available, reopen this pull request to trigger a review.

# Summary

- Fixes restatedev#4456 by making sure:
  - Request stream is closed immediately after the we receive a terminal state
  - Drain the response stream. This also fixes a connection thrashing issue
## Summary
- Introduce Connection<C>, a Tower Service-based HTTP/2 connection that multiplexes requests over a single H2 session with semaphore-backed concurrency control
- Add TcpConnector service and ConnectionInfo/IntoConnectionInfo abstractions for URI-based TCP connection establishment
## Summary
- Add AuthorityPool<C> that manages multiple H2 connections to a single authority (scheme+host+port), creating connections on demand when streams are exhausted and evicting failed ones
- Add Pool<C> that routes requests to the correct AuthorityPool via a DashMap<ConnectionInfo, AuthorityPool<C>>
- Add PoolBuilder with configurable max_connections and init_max_streams per authority
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