Skip to content

Commit

Permalink
Remove a unnecessary sleep in run server (solana-labs#32216)
Browse files Browse the repository at this point in the history
remove sleep; and handle initializing connection as soon as available
  • Loading branch information
lijunwangs authored and wen-coding committed Aug 15, 2023
1 parent 35d37b2 commit 7cb758f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions streamer/src/nonblocking/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ use {
},
time::{Duration, Instant},
},
tokio::{
task::JoinHandle,
time::{sleep, timeout},
},
tokio::{task::JoinHandle, time::timeout},
};

const WAIT_FOR_STREAM_TIMEOUT: Duration = Duration::from_millis(100);
Expand Down Expand Up @@ -135,7 +132,6 @@ async fn run_server(
coalesce: Duration,
) {
const WAIT_FOR_CONNECTION_TIMEOUT: Duration = Duration::from_secs(1);
const WAIT_BETWEEN_NEW_CONNECTIONS: Duration = Duration::from_millis(1);
debug!("spawn quic server");
let mut last_datapoint = Instant::now();
let unstaked_connection_table: Arc<Mutex<ConnectionTable>> = Arc::new(Mutex::new(
Expand Down Expand Up @@ -173,7 +169,6 @@ async fn run_server(
stats.clone(),
wait_for_chunk_timeout,
));
sleep(WAIT_BETWEEN_NEW_CONNECTIONS).await;
} else {
debug!("accept(): Timed out waiting for connection");
}
Expand Down

0 comments on commit 7cb758f

Please sign in to comment.