[Service-Client] H2 Pool integation and usage in service client#4493
[Service-Client] H2 Pool integation and usage in service client#4493muhamadazmy wants to merge 3 commits intorestatedev:mainfrom
Conversation
eb9b4ca to
a7b78b3
Compare
|
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. |
01461e0 to
5857bf0
Compare
71da9b7 to
2e8b9fc
Compare
tillrohrmann
left a comment
There was a problem hiding this comment.
Thanks for integrating the connection pool into the HttpClient @muhamadazmy. I left a few minor comments. Did you run any benchmarks to see whether the new connection pool has any performance implications?
| //todo: this is a temp clone to test | ||
| Self::WaitingHeaders { | ||
| join_handle: AbortOnDropHandle::new(tokio::task::spawn(client.call(req))), | ||
| } |
There was a problem hiding this comment.
What are we testing here? Should this become part of main if it's for testing?
| /// Client when HTTP2 was specifically requested - for cleartext, we use h2c, | ||
| /// and for HTTPS, we will fail unless the ALPN supports h2. | ||
| /// In practice, at discovery time we never force h2 for HTTPS. |
| /// type complexity for higher layer | ||
| #[pin_project::pin_project] | ||
| pub struct ResponseBody { | ||
| #[pin] |
There was a problem hiding this comment.
Why is pin needed here? Is Incoming !Unpin?
| /// **NOTE**: Setting this value to None (default) users the default | ||
| /// recommended value from HTTP2 specs | ||
| pub initial_max_send_streams: Option<usize>, | ||
| pub initial_max_send_streams: Option<u32>, |
There was a problem hiding this comment.
Is Some(0) a valid value here?
crates/types/src/config/http.rs
Outdated
| /// If the ping is not acknowledged within the timeout, the connection will | ||
| /// be closed. | ||
| /// | ||
| /// Only meaningful when `keep_alive_interval` is `Some`. Defaults to 20 s. |
There was a problem hiding this comment.
What is keep_alive_interval referring to?
44dd0bf to
3862f24
Compare
e49e78d to
43b08ad
Compare
## 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
- This PR finally enable using of the new H2 pool in the http service client. Fixes restatedev#4451
[Service-Client] H2 Pool integation and usage in service client
Fixes #4451
Stack created with Sapling. Best reviewed with ReviewStack.