Skip to content

Commit

Permalink
rebase with quinn-rs/quinn#1752
Browse files Browse the repository at this point in the history
  • Loading branch information
lijunwangs committed Mar 31, 2024
1 parent 4026ce5 commit 52f4e0f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 34 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
24 changes: 12 additions & 12 deletions core/src/repair/quic_endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -786,15 +786,15 @@ impl<T> From<crossbeam_channel::SendError<T>> 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,
connection_error_reset: AtomicU64,
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,
Expand Down Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand Down Expand Up @@ -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
),
(
Expand Down Expand Up @@ -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
),
(
Expand Down
2 changes: 0 additions & 2 deletions streamer/src/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 15 additions & 15 deletions turbine/src/quic_endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,15 +637,15 @@ impl<T> From<crossbeam_channel::SendError<T>> 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,
connection_error_reset: AtomicU64,
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,
Expand All @@ -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)
}
Expand All @@ -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)
}
Expand Down Expand Up @@ -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),
Expand All @@ -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),
Expand All @@ -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
),
(
Expand Down

0 comments on commit 52f4e0f

Please sign in to comment.