Skip to content

Commit

Permalink
v1.17: quic: delay calling set_max_concurrent_uni_streams/set_receive…
Browse files Browse the repository at this point in the history
…_window (backport of solana-labs#904) (solana-labs#967)

* quic: delay calling set_max_concurrent_uni_streams/set_receive_window (solana-labs#904)

* quic: don't call connection.set_max_concurrent_uni_streams if we're going to drop a connection

Avoids taking a mutex and waking a task.

* quic: don't increase the receive window before we've actually accepted a connection

(cherry picked from commit 2770424)

# Conflicts:
#	streamer/src/nonblocking/quic.rs

* Fix merge conflicts

---------

Co-authored-by: Alessandro Decina <[email protected]>
  • Loading branch information
mergify[bot] and alessandrod authored Apr 30, 2024
1 parent 4f9c393 commit 72d6e89
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions streamer/src/nonblocking/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,18 +342,12 @@ fn handle_and_cache_new_connection(
params.total_stake,
) as u64)
{
connection.set_max_concurrent_uni_streams(max_uni_streams);
let receive_window = compute_recieve_window(
params.max_stake,
params.min_stake,
connection_table_l.peer_type,
params.stake,
);

if let Ok(receive_window) = receive_window {
connection.set_receive_window(receive_window);
}

let remote_addr = connection.remote_address();

debug!(
Expand All @@ -376,6 +370,12 @@ fn handle_and_cache_new_connection(
) {
let peer_type = connection_table_l.peer_type;
drop(connection_table_l);

if let Ok(receive_window) = receive_window {
connection.set_receive_window(receive_window);
}
connection.set_max_concurrent_uni_streams(max_uni_streams);

tokio::spawn(handle_connection(
connection,
remote_addr,
Expand Down

0 comments on commit 72d6e89

Please sign in to comment.