From 85438889c63308ca8582bee04ebac4baae91cea8 Mon Sep 17 00:00:00 2001 From: Lijun Wang <83639177+lijunwangs@users.noreply.github.com> Date: Sat, 30 Mar 2024 19:03:06 -0700 Subject: [PATCH] rebase with https://github.com/quinn-rs/quinn/pull/1752 --- Cargo.lock | 6 +++--- Cargo.toml | 4 ++-- core/src/repair/quic_endpoint.rs | 24 ++++++++++++------------ streamer/src/quic.rs | 2 -- turbine/src/quic_endpoint.rs | 30 +++++++++++++++--------------- 5 files changed, 32 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ae86eb98f3c367..27a82261a5a5af 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4336,7 +4336,7 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quinn" version = "0.11.0" -source = "git+https://github.com/lijunwangs/quinn.git?rev=ff9917692b9b2fa9b3099ca1143d28c240b68d9c#ff9917692b9b2fa9b3099ca1143d28c240b68d9c" +source = "git+https://github.com/lijunwangs/quinn.git?rev=5980492919744a8366ce74a837b64e052aff9944#5980492919744a8366ce74a837b64e052aff9944" dependencies = [ "bytes", "pin-project-lite", @@ -4352,7 +4352,7 @@ dependencies = [ [[package]] name = "quinn-proto" version = "0.11.0" -source = "git+https://github.com/lijunwangs/quinn.git?rev=ff9917692b9b2fa9b3099ca1143d28c240b68d9c#ff9917692b9b2fa9b3099ca1143d28c240b68d9c" +source = "git+https://github.com/lijunwangs/quinn.git?rev=5980492919744a8366ce74a837b64e052aff9944#5980492919744a8366ce74a837b64e052aff9944" dependencies = [ "bytes", "rand 0.8.5", @@ -4369,7 +4369,7 @@ dependencies = [ [[package]] name = "quinn-udp" version = "0.5.0" -source = "git+https://github.com/lijunwangs/quinn.git?rev=ff9917692b9b2fa9b3099ca1143d28c240b68d9c#ff9917692b9b2fa9b3099ca1143d28c240b68d9c" +source = "git+https://github.com/lijunwangs/quinn.git?rev=5980492919744a8366ce74a837b64e052aff9944#5980492919744a8366ce74a837b64e052aff9944" dependencies = [ "bytes", "libc", diff --git a/Cargo.toml b/Cargo.toml index 70ba20b8b1fe5c..b4f3e1e37084af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -268,8 +268,8 @@ qstring = "0.7.2" qualifier_attr = { version = "0.2.2", default-features = false } #quinn = "0.10.2" #quinn-proto = "0.10.5" -quinn = {git = "https://github.com/lijunwangs/quinn.git", rev = "ff9917692b9b2fa9b3099ca1143d28c240b68d9c"} -quinn-proto = {git = "https://github.com/lijunwangs/quinn.git", rev = "ff9917692b9b2fa9b3099ca1143d28c240b68d9c"} +quinn = {git = "https://github.com/lijunwangs/quinn.git", rev = "5980492919744a8366ce74a837b64e052aff9944"} +quinn-proto = {git = "https://github.com/lijunwangs/quinn.git", rev = "5980492919744a8366ce74a837b64e052aff9944"} quote = "1.0" rand = "0.8.5" rand_chacha = "0.3.1" diff --git a/core/src/repair/quic_endpoint.rs b/core/src/repair/quic_endpoint.rs index 9323ab00e7b9b6..330298d1d1c681 100644 --- a/core/src/repair/quic_endpoint.rs +++ b/core/src/repair/quic_endpoint.rs @@ -786,7 +786,7 @@ impl From> for Error { struct RepairQuicStats { connect_error_invalid_remote_address: AtomicU64, connect_error_other: AtomicU64, - connect_error_too_many_connections: AtomicU64, + connect_error_cids_exhausted: AtomicU64, connection_error_application_closed: AtomicU64, connection_error_connection_closed: AtomicU64, connection_error_locally_closed: AtomicU64, @@ -794,7 +794,7 @@ struct RepairQuicStats { connection_error_timed_out: AtomicU64, connection_error_transport_error: AtomicU64, connection_error_version_mismatch: AtomicU64, - connection_error_connection_limit_exceeded: AtomicU64, + connection_error_cids_exhausted: AtomicU64, invalid_identity: AtomicU64, no_response_received: AtomicU64, read_to_end_error_connection_lost: AtomicU64, @@ -823,15 +823,9 @@ fn record_error(err: &Error, stats: &RepairQuicStats) { match err { Error::CertificateError(_) => (), Error::ChannelSendError => (), - Error::ConnectionError(ConnectionError::ConnectionLimitExceeded) => { - add_metric!(stats.connection_error_connection_limit_exceeded) - } Error::ConnectError(ConnectError::EndpointStopping) => { add_metric!(stats.connect_error_other) } - Error::ConnectError(ConnectError::TooManyConnections) => { - add_metric!(stats.connect_error_too_many_connections) - } Error::ConnectError(ConnectError::InvalidDnsName(_)) => { add_metric!(stats.connect_error_other) } @@ -844,6 +838,12 @@ fn record_error(err: &Error, stats: &RepairQuicStats) { Error::ConnectError(ConnectError::UnsupportedVersion) => { add_metric!(stats.connect_error_other) } + Error::ConnectError(ConnectError::CidsExhausted) => { + add_metric!(stats.connect_error_cids_exhausted) + } + Error::ConnectionError(ConnectionError::CidsExhausted) => { + add_metric!(stats.connection_error_cids_exhausted) + } Error::ConnectionError(ConnectionError::VersionMismatch) => { add_metric!(stats.connection_error_version_mismatch) } @@ -918,8 +918,8 @@ fn report_metrics(name: &'static str, stats: &RepairQuicStats) { i64 ), ( - "connect_error_too_many_connections", - reset_metric!(stats.connect_error_too_many_connections), + "connect_error_cids_exhausted", + reset_metric!(stats.connect_error_cids_exhausted), i64 ), ( @@ -958,8 +958,8 @@ fn report_metrics(name: &'static str, stats: &RepairQuicStats) { i64 ), ( - "connection_error_connection_limit_exceeded", - reset_metric!(stats.connection_error_connection_limit_exceeded), + "connection_error_cids_exhausted", + reset_metric!(stats.connection_error_cids_exhausted), i64 ), ( diff --git a/streamer/src/quic.rs b/streamer/src/quic.rs index 34accd8e29a6d1..0c84bd496300ea 100644 --- a/streamer/src/quic.rs +++ b/streamer/src/quic.rs @@ -74,8 +74,6 @@ pub(crate) fn configure_server( server_tls_config.alpn_protocols = vec![ALPN_TPU_PROTOCOL_ID.to_vec()]; let mut server_config = ServerConfig::with_crypto(Arc::new(server_tls_config)); - server_config - .concurrent_connections(2 * (MAX_STAKED_CONNECTIONS + MAX_UNSTAKED_CONNECTIONS) as u32); let config = Arc::get_mut(&mut server_config.transport).unwrap(); // QUIC_MAX_CONCURRENT_STREAMS doubled, which was found to improve reliability diff --git a/turbine/src/quic_endpoint.rs b/turbine/src/quic_endpoint.rs index d8a57d4eea22e0..10046b7e8f9f34 100644 --- a/turbine/src/quic_endpoint.rs +++ b/turbine/src/quic_endpoint.rs @@ -637,7 +637,7 @@ impl From> for Error { struct TurbineQuicStats { connect_error_invalid_remote_address: AtomicU64, connect_error_other: AtomicU64, - connect_error_too_many_connections: AtomicU64, + connect_error_cids_exhausted: AtomicU64, connection_error_application_closed: AtomicU64, connection_error_connection_closed: AtomicU64, connection_error_locally_closed: AtomicU64, @@ -645,7 +645,7 @@ struct TurbineQuicStats { connection_error_timed_out: AtomicU64, connection_error_transport_error: AtomicU64, connection_error_version_mismatch: AtomicU64, - connection_error_connection_limit_exceeded: AtomicU64, + connection_error_cids_exhausted: AtomicU64, invalid_identity: AtomicU64, router_try_send_error_full: AtomicU64, send_datagram_error_connection_lost: AtomicU64, @@ -664,15 +664,9 @@ fn record_error(err: &Error, stats: &TurbineQuicStats) { match err { Error::CertificateError(_) => (), Error::ChannelSendError => (), - Error::ConnectionError(ConnectionError::ConnectionLimitExceeded) => { - add_metric!(stats.connection_error_connection_limit_exceeded) - } Error::ConnectError(ConnectError::EndpointStopping) => { add_metric!(stats.connect_error_other) } - Error::ConnectError(ConnectError::TooManyConnections) => { - add_metric!(stats.connect_error_too_many_connections) - } Error::ConnectError(ConnectError::InvalidDnsName(_)) => { add_metric!(stats.connect_error_other) } @@ -685,6 +679,12 @@ fn record_error(err: &Error, stats: &TurbineQuicStats) { Error::ConnectError(ConnectError::UnsupportedVersion) => { add_metric!(stats.connect_error_other) } + Error::ConnectError(ConnectError::CidsExhausted) => { + add_metric!(stats.connect_error_cids_exhausted) + } + Error::ConnectionError(ConnectionError::CidsExhausted) => { + add_metric!(stats.connection_error_cids_exhausted) + } Error::ConnectionError(ConnectionError::VersionMismatch) => { add_metric!(stats.connection_error_version_mismatch) } @@ -738,11 +738,6 @@ fn report_metrics(name: &'static str, stats: &TurbineQuicStats) { reset_metric!(stats.connect_error_other), i64 ), - ( - "connect_error_too_many_connections", - reset_metric!(stats.connect_error_too_many_connections), - i64 - ), ( "connection_error_application_closed", reset_metric!(stats.connection_error_application_closed), @@ -763,6 +758,11 @@ fn report_metrics(name: &'static str, stats: &TurbineQuicStats) { reset_metric!(stats.connection_error_reset), i64 ), + ( + "connect_error_cids_exhausted", + reset_metric!(stats.connect_error_cids_exhausted), + i64 + ), ( "connection_error_timed_out", reset_metric!(stats.connection_error_timed_out), @@ -779,8 +779,8 @@ fn report_metrics(name: &'static str, stats: &TurbineQuicStats) { i64 ), ( - "connection_error_connection_limit_exceeded", - reset_metric!(stats.connection_error_connection_limit_exceeded), + "connection_error_cids_exhausted", + reset_metric!(stats.connection_error_cids_exhausted), i64 ), (