From f244a2e1413422e26aa6399e994260b378479cc7 Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Tue, 26 Apr 2022 14:25:02 -0700 Subject: [PATCH] Increase worker thread limits in quic streamer runtime (#24535) * Increase worker thread limits in quic streamer runtime * fix Cargo.lock * fix test, and use a constant for controlling thread count --- streamer/src/quic.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/streamer/src/quic.rs b/streamer/src/quic.rs index cb1b678ac..4cae513b6 100644 --- a/streamer/src/quic.rs +++ b/streamer/src/quic.rs @@ -31,6 +31,7 @@ use { pub const MAX_STAKED_CONNECTIONS: usize = 2000; pub const MAX_UNSTAKED_CONNECTIONS: usize = 500; +const NUM_QUIC_STREAMER_WORKER_THREADS: usize = 4; /// Returns default server configuration along with its PEM certificate chain. #[allow(clippy::field_reassign_with_default)] // https://github.com/rust-lang/rust-clippy/issues/6527 @@ -131,7 +132,7 @@ fn new_cert_params(identity_keypair: &Keypair, san: IpAddr) -> CertificateParams fn rt() -> Runtime { Builder::new_multi_thread() - .worker_threads(1) + .worker_threads(NUM_QUIC_STREAMER_WORKER_THREADS) .enable_all() .build() .unwrap() @@ -700,8 +701,9 @@ mod test { let mut s1 = conn1.connection.open_uni().await.unwrap(); let mut s2 = conn2.connection.open_uni().await.unwrap(); s1.write_all(&[0u8]).await.unwrap(); + s2.write_all(&[0u8]).await.unwrap(); s1.finish().await.unwrap(); - s2.write_all(&[0u8]) + s2.finish() .await .expect_err("shouldn't be able to open 2 connections"); });