Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lower the timeout values for the rust connection #267

Merged
merged 2 commits into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions xmtp_networking/src/grpc_api_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
fn tls_config() -> ClientConfig {
let mut roots = RootCertStore::empty();
// Need to convert into OwnedTrustAnchor
roots.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|ta| {

Check warning on line 22 in xmtp_networking/src/grpc_api_helper.rs

View workflow job for this annotation

GitHub Actions / build-macos (x86_64-apple-ios)

use of deprecated method `tokio_rustls::rustls::RootCertStore::add_server_trust_anchors`: Please use `add_trust_anchors` instead

Check warning on line 22 in xmtp_networking/src/grpc_api_helper.rs

View workflow job for this annotation

GitHub Actions / build-macos (aarch64-apple-ios)

use of deprecated method `tokio_rustls::rustls::RootCertStore::add_server_trust_anchors`: Please use `add_trust_anchors` instead

Check warning on line 22 in xmtp_networking/src/grpc_api_helper.rs

View workflow job for this annotation

GitHub Actions / build-macos (aarch64-apple-darwin)

use of deprecated method `tokio_rustls::rustls::RootCertStore::add_server_trust_anchors`: Please use `add_trust_anchors` instead

Check warning on line 22 in xmtp_networking/src/grpc_api_helper.rs

View workflow job for this annotation

GitHub Actions / build-macos (aarch64-apple-ios-sim)

use of deprecated method `tokio_rustls::rustls::RootCertStore::add_server_trust_anchors`: Please use `add_trust_anchors` instead

Check warning on line 22 in xmtp_networking/src/grpc_api_helper.rs

View workflow job for this annotation

GitHub Actions / build-macos (x86_64-apple-darwin)

use of deprecated method `tokio_rustls::rustls::RootCertStore::add_server_trust_anchors`: Please use `add_trust_anchors` instead

Check warning on line 22 in xmtp_networking/src/grpc_api_helper.rs

View workflow job for this annotation

GitHub Actions / Test

use of deprecated method `tokio_rustls::rustls::RootCertStore::add_server_trust_anchors`: Please use `add_trust_anchors` instead

Check warning on line 22 in xmtp_networking/src/grpc_api_helper.rs

View workflow job for this annotation

GitHub Actions / Test

use of deprecated method `tokio_rustls::rustls::RootCertStore::add_server_trust_anchors`: Please use `add_trust_anchors` instead
OwnedTrustAnchor::from_subject_spki_name_constraints(
ta.subject,
ta.spki,
Expand Down Expand Up @@ -53,12 +53,12 @@
pub enum InnerApiClient {
Plain(MessageApiClient<Channel>),
Tls(
MessageApiClient<
hyper::Client<
HttpsConnector<tower::timeout::Timeout<HttpConnector>>,
UnsyncBoxBody<hyper::body::Bytes, Status>,
>,
>,

Check warning on line 61 in xmtp_networking/src/grpc_api_helper.rs

View workflow job for this annotation

GitHub Actions / workspace

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions --> xmtp_networking/src/grpc_api_helper.rs:56:9 | 56 | / MessageApiClient< 57 | | hyper::Client< 58 | | HttpsConnector<tower::timeout::Timeout<HttpConnector>>, 59 | | UnsyncBoxBody<hyper::body::Bytes, Status>, 60 | | >, 61 | | >, | |_________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity = note: `#[warn(clippy::type_complexity)]` on by default
),
}

Expand All @@ -74,8 +74,8 @@
let connector = get_tls_connector();

let tls_conn = hyper::Client::builder()
.pool_idle_timeout(Duration::from_secs(30))
.http2_keep_alive_interval(Duration::from_secs(10))
.pool_idle_timeout(Duration::from_secs(5))
.http2_keep_alive_interval(Duration::from_secs(3))
.http2_keep_alive_timeout(Duration::from_secs(5))
.build(connector);

Expand All @@ -93,8 +93,8 @@
.map_err(|e| Error::new(ErrorKind::SetupError).with(e))?
.timeout(Duration::from_secs(5))
.connect_timeout(Duration::from_secs(5))
.tcp_keepalive(Some(Duration::from_secs(10)))
.http2_keep_alive_interval(Duration::from_secs(10))
.tcp_keepalive(Some(Duration::from_secs(3)))
.http2_keep_alive_interval(Duration::from_secs(3))
.keep_alive_timeout(Duration::from_secs(5))
.connect()
.await
Expand Down
Loading